julienXX / terminal-notifier

Send User Notifications on macOS from the command-line.
Other
6.37k stars 330 forks source link

1.8 breaks open with local files (without hosts) #215

Closed mikaelbr closed 7 years ago

mikaelbr commented 7 years ago

Please check everything that applies to your issue:

To help us debug your issue please include:

Reproduce

Run command with file:// as open.

This commit (https://github.com/julienXX/terminal-notifier/commit/94738f8ac9acec635704d5716267856707306857), is a stricter check on URL and causes local files to no longer work as it requires host. Is this intentional?

julienXX commented 7 years ago

It's not intentional sorry, I'll try to fix it quickly.

mikaelbr commented 7 years ago

Thanks for the incredibly swift reply. 👍

julienXX commented 7 years ago

It does work if you comply with the file:// protocol though: terminal-notifier -message 'hello' -open file://localhost/Users/julien/Downloads/IMG_0317.JPG worked for me. So not sure it should be "fixed". What's your take on this?

mikaelbr commented 7 years ago

Hm. That's fascinating. For some reason I've never seen using localhost as host on the file scheme before. That does seem to work. But file:///Users/julien/Downloads/IMG_0317.JPG without host doesn't. Is file:///Users/julien/Downloads/IMG_0317.JPG actually invalid?

julienXX commented 7 years ago

Both syntax are valid https://en.wikipedia.org/wiki/File_URI_scheme, I'll update the code accordingly :)

julienXX commented 7 years ago

Fixed, I'll wait a bit for more issues before releasing a new version.

mikaelbr commented 7 years ago

Great. Thank you