Skip to content
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

consider including working example(s) #7

Closed
tmc opened this issue Jul 30, 2016 · 7 comments
Closed

consider including working example(s) #7

tmc opened this issue Jul 30, 2016 · 7 comments

Comments

@tmc
Copy link

tmc commented Jul 30, 2016

Working minimal examples would help illustrate the use of this package.

@dmitshur
Copy link
Member

dmitshur commented Jul 30, 2016

Sounds like a good idea, I'll do that.

Until this is resolved, feel free to look at Instant Share client source, which uses this package.

@dmitshur
Copy link
Member

dmitshur commented Jul 31, 2016

@jacobrosenthal
Copy link

Hrm. Trying this now but unsuccessful. Added the plist, an icon, changed name of the CFBundleExecutable, but when I click nothing happens. The only thing in the console is a quicklooksattelite: no file data for file file:///something.app

@dmitshur
Copy link
Member

dmitshur commented Aug 1, 2016

Which icon did you add? The example mentions "app-icon@2x.png", which needs to be in the Resources folder. That's the tray icon. There's also Icon.icns which is for the app bundle icon.

@jacobrosenthal
Copy link

Thanks for the response. Both actually. Im also playing with the Instant Share app you linked above.

@jacobrosenthal
Copy link

Is there some naming that has to match, inside the go app and in the plist, etc? Is there some logging I can add? Im actually not that familiar with go otherwise.

@dmitshur
Copy link
Member

dmitshur commented Aug 2, 2016

Thanks for the reproduce case in #8. With that, I was able to reproduce the issue and I now know what's wrong.

The problem was that by default, when launched via Finder, an app bundle will have its working directory at root (/) instead of inside the app bundle's Resources directory.

The reason it worked for my Instant Share.app is because I had the following bash script inside, which was executed first:

#!/bin/bash

WD=$(dirname "$0")
cd "${WD}/../Resources"
../MacOS/main -flags -here >log.txt 2>&1

I named that script wd and pointed it as the executable to run in the Info.plist file:

<key>CFBundleExecutable</key>
<string>wd</string>

So, that answers the question of how to logging (and specify flags, if you want).

I definitely did not document this part in the example, so I need to fix that.

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

No branches or pull requests

3 participants