mushanshitiancai / vscode-paste-image

paste image from clipboard to markdown/asciidoc directly!
MIT License
423 stars 128 forks source link

Added configuration for image path #4

Closed ysknkd closed 7 years ago

ysknkd commented 7 years ago

I added an image output destination setting. Please let me know what you think.

Thanks, Yosuke Nakada.

mushanshitiancai commented 7 years ago

Excellent!

I add this future to todo list, but I’m too busy to implement it..So very thank you for you commit.

I try it on you branch, it work, but when I add negligently a blank before the config path, extension crash:

"pasteImage.path": " /Users/mazhibin/hello”

image

It seems that if path start with blanks, path. isAbsolute() return false. And then mkdir() fail.

So could you preprocess the config and add try-catch around mkdir, if catch a exception, show a message to users.

Best Wishes mushan

ysknkd commented 7 years ago

Thank you for checking. Fix to show a message when the path is invalid.

mushanshitiancai commented 7 years ago

I have published extension. Thank you.