Skip to content

Instantly share code, notes, and snippets.

@mbostock
Last active February 9, 2016 01:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbostock/5e68f4edaf4b42944d87 to your computer and use it in GitHub Desktop.
Save mbostock/5e68f4edaf4b42944d87 to your computer and use it in GitHub Desktop.
launchd Startup Script
license: gpl-3.0

Save this file to ~/Library/LaunchAgents. Then, to load the script (and start it automatically):

launchctl load ~/Library/LaunchAgents/org.ocks.bl.localhost.plist
<?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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment