8000 fix for providing an icon path in POSIX format by cwinters8 · Pull Request #12 · andybrewer/mack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix for providing an icon path in POSIX format #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cwinters8
Copy link

stumbled on an issue with supplying a local path to an icon file, where this error occurs:

exit status 1: 0:85: execution error: A resource wasn’t found. (-192) (display dialog "time's up!" with title "5s timer" with icon "./assets/clock_red.icns")

ultimately, the error occurs because applescript seems to expect files to be referenced by colon-delimited paths, otherwise known as a Hierarchical File System (HFS) path. you can tell applescript the path is POSIX format by adding the directive POSIX path before the file path is provided.

sorry for the very noisy diff - gofmt insisted on changing all the spaces to tabs. the specific change I am hoping to contribute here is found on line 84 here. if you'd like I can restore the original files and make the necessary changes with formatOnSave disabled as described here, because apparently there is currently no way to modify gofmt's behavior when used with the VS code extension.

the corresponding test is also updated, with similar space -> tab conversions by gofmt unfortunately.

I'm also wondering if this should be implemented in a more conditional manner, maybe with some special handling depending on if the dialog.Icon path is detected as POSIX or HFS format? I could add that logic as well if it would be helpful. the reason I did not implement that logic already is because I find it doubtful that most people will specify paths in HFS format, but I could definitely be wrong.

thanks for reviewing this!

@cwinters8
Copy link
Author

this may address #11, if a dialog box is acceptable instead of a notification when a custom icon is needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0