Skip to content

Instantly share code, notes, and snippets.

@AaronNGray
Created October 6, 2019 19:19
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 AaronNGray/0648f396844bff30633319b268b253b4 to your computer and use it in GitHub Desktop.
Save AaronNGray/0648f396844bff30633319b268b253b4 to your computer and use it in GitHub Desktop.
How to install npm_lazy as a Mac OS X Launcher from the command line.

How to install npm_lazy as a Mac OS X Launcher from the command line.

NOT TESTED YET

Install npm_lazy globally :-

npm install -g npm_lazy

Create the configuration file :-

npm_lazy --init > ~/npm_lazy.config.js"

Create the following two scripts :-

~/Scripts/npm_lazy.sh

# ~/Scripts/npm_lazy.sh
#!/bin/sh
npm_lazy --config ~\npm_lazy.config.js

~/Library/LaunchAgents/org.npm_lazy.launcher.plist

# ~/Library/LaunchAgents/org.npm_lazy.launcher.plist
<?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>Label</key>
	<string>org.npm_lazy.launcher</string>
	<key>Program</key>
	<string>/Users/user/Scripts/npm_lazy.sh</string>
	<key>RunAtLoad</key>
	<true/>
</dict>
</plist>

Load the launcher plist :-

sudo launchctl load ~/Library/LaunchAgents/org.npm_lazy.launcher.plist

Start the launcher :-

sudo launchctl start org.npm_lazy.launcher.plist

Stop the launcher :-

sudo launchctl stop org.npm_lazy.launcher.plist

Unload the launcher plist :-

sudo launchctl unload org.npm_lazy.launcher.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment