Skip to content

Instantly share code, notes, and snippets.

@AaronNGray
Created October 6, 2019 18:59
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/6137fb0cf6c27f7ed457f5ac976816d6 to your computer and use it in GitHub Desktop.
Save AaronNGray/6137fb0cf6c27f7ed457f5ac976816d6 to your computer and use it in GitHub Desktop.

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

NOT TESTED YET

Install verdaccio globally :-

npm install -g verdaccio

Create the following two scripts :-

~/Scripts/verdaccio.sh

# ~/Scripts/verdaccio.sh
#!/bin/sh
verdaccio -c `npm root -g`/verdaccio/config.xaml

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

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

Load the launcher plist :-

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

Start the launcher :-

sudo launchctl start org.verdaccio.launcher.plist

Stop the launcher :-

sudo launchctl stop org.verdaccio.launcher.plist

Unload the launcher plist :-

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