Save this file to ~/Library/LaunchAgents. Then, to load the script (and start it automatically):
launchctl load ~/Library/LaunchAgents/org.ocks.bl.localhost.plist| license: gpl-3.0 |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>Label</key> | |
| <string>org.ocks.bl.localhost</string> | |
| <key>RunAtLoad</key> | |
| <true/> | |
| <key>WorkingDirectory</key> | |
| <string>/Users/mbostock/Development/gists</string> | |
| <key>ProgramArguments</key> | |
| <array> | |
| <string>/usr/local/bin/http-server</string> | |
| <string>-p</string> | |
| <string>8008</string> | |
| </array> | |
| <key>EnvironmentVariables</key> | |
| <dict> | |
| <key>PATH</key> | |
| <string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string> | |
| </dict> | |
| </dict> | |
| </plist> |