Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Hubot .plist for running via launchctl on OSX
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.nheinric.hubot</string>
<!-- LSEnvironment does not work for PATH. I don't know why.
https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/uid/20001431-106825
-->
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>-c</string>
<string>export PATH=/usr/local/bin:/usr/local/Cellar/ruby/2.1.0/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin; /Users/nheinric/workspace/hubot/go.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>/Users/nheinric/workspace/hubot</string>
</dict>
</plist>

gb96 commented Dec 9, 2014

Thanks for sharing!
I suspect the /bin/sh and -c are redundant assuming go.sh file has global execute permission and begins with #!/bin/sh ... Also I think the export PATH=... is probably not required either. If you needed to modify default PATH you could put the export PATH statement inside go.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment