chrome-devtools-autosave-server icon indicating copy to clipboard operation
chrome-devtools-autosave-server copied to clipboard

Start on OS launch

Open NV opened this issue 13 years ago • 1 comments

Make a postinstall npm hook for all major operating systems.

http://en.wikipedia.org/wiki/Init

Mac OS X

Create a ~/Library/LaunchAgents/com.chrome.devtools.autosave.launchd.plist file with the following content:

<?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>com.chrome.devtools.autosave.launchd</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/bin/autosave</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
    <key>KeepAlive</key>
    <true/>
  <key>EnvironmentVariables</key>
  <dict>
    <key>PATH</key>
    <string>/usr/local/bin</string><!-- dirname $(which node) -->
  </dict>
    <key>StandardOutPath</key>
    <string>/var/log/autosave.log</string>
    <key>StandardErrorPath</key>
    <string>/var/log/autosave.error.log</string>
</dict>
</plist>

Make sure it works:

➤ launchctl load ~/Library/LaunchAgents/com.chrome.devtools.autosave.launchd.plist
➤ launchctl list | grep chrome
38609   -   com.chrome.devtools.autosave.launchd

Enjoy.

Windows

http://en.wikipedia.org/wiki/Windows_Registry#Command_line_editing

Linux

FreeBSD

rc.d

NV avatar Feb 17 '12 04:02 NV

Just made it work on Ubuntu, although I haven’t tested it much since I’m not Ubuntu user. Please npm link the repo and let me know how it goes.

NV avatar May 21 '12 19:05 NV