Last active
July 25, 2016 03:09
-
-
Save senki/a37172794bdedd3f479b to your computer and use it in GitHub Desktop.
Revisions
-
senki revised this gist
Jul 25, 2016 . 3 changed files with 4 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,9 +3,9 @@ Make sure the terminal notifier is installed. Install it wia `brew install terminal-notifier` command. The script assumes the **iTerm** is installed. Go get it, or edit the `npm-update-notifier.sh` for your need. 1. Put `notify-update-npm.sh` to your `~/bin/` directory 2. Put `notify.update.npm.plist` to your `~/Library/LaunchAgents/` directory 3. Run `launchctl load ~/Library/LaunchAgents/notify.update.npm.plist` This script is run twice a day at 11 AM & 4 PM. Based on Based on Chris Streeters' `brew-update-notifier.sh` work from https://gist.github.com/streeter/3254906 This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,9 +8,6 @@ # brew install terminal-notifier # NPM_EXEC='/usr/local/bin/npm' TERMINAL_NOTIFIER='/usr/local/bin/terminal-notifier' NOTIF_ARGS="-activate com.googlecode.iterm2 -sound NotificationCenter" This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,7 +9,7 @@ <key>ProgramArguments</key> <array> <string>/bin/bash</string> <string>/Users/USERNAME/bin/notify-update-npm.sh</string> </array> <key>EnvironmentVariables</key> <dict> -
senki revised this gist
Jul 25, 2016 . 2 changed files with 20 additions and 18 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,14 +3,17 @@ # Notify of npm updates via Notification Center on Mac OS X # # Author Csaba Maulis @_senki # Based on Chris Streeters (http://www.chrisstreeter.com) `brew-update-notifier.sh` # Requires: terminal-notifier. Install with: # brew install terminal-notifier # export PATH="/usr/local/sbin:/usr/local/bin:$PATH" NPM_EXEC='/usr/local/bin/npm' TERMINAL_NOTIFIER='/usr/local/bin/terminal-notifier' NOTIF_ARGS="-activate com.googlecode.iterm2 -sound NotificationCenter" # Remove pinned package from the list of outdated package outdated=`$NPM_EXEC outdated -g | awk '{if (NR!=1) {print $1}}'` @@ -19,8 +22,8 @@ if [ -z "$outdated" ] ; then if [ -e $TERMINAL_NOTIFIER ]; then # No updates available $TERMINAL_NOTIFIER $NOTIF_ARGS \ -title "NPM: No Updates Available" \ -message "No updates available yet for any global package." fi else # We've got an outdated package or two @@ -29,9 +32,9 @@ else if [ -e $TERMINAL_NOTIFIER ]; then lc=$((`echo "$outdated" | wc -l`)) if [ $lc -gt 1 ]; then title="NPM: $lc Updates Available" else title="NPM: 1 Updates Available" fi outdated=`echo "$outdated" | tail -$lc` message=`echo "$outdated" | head -5` This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,29 +5,28 @@ <key>EnableGlobbing</key> <false/> <key>Label</key> <string>notify.update.npm</string> <key>ProgramArguments</key> <array> <string>/bin/bash</string> <string>/Users/maulis/bin/notify-update-npm</string> </array> <key>EnvironmentVariables</key> <dict> <key>PATH</key> <string>/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin</string> </dict> <key>StartInterval</key> <true/> <key>StandardErrorPath</key> <string>/tmp/notify.update.npm.err</string> <key>StandardOutPath</key> <string>/tmp/notify.update.npm.out</string> <key>StartCalendarInterval</key> <array> <dict> <key>Hour</key> <integer>15</integer> <key>Minute</key> <integer>0</integer> </dict> -
senki revised this gist
Jun 9, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,4 +8,4 @@ The script assumes the **iTerm** is installed. Go get it, or edit the `npm-updat 3. Run `launchctl load ~/Library/LaunchAgents/npm.npm.update-notifier.plist` This script is run twice a day at 11 AM & 4 PM. Based on Based on Chris Streeters' `brew-update-notifier.sh` work from https://gist.github.com/streeter/3254906 -
senki created this gist
Jun 9, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ # Notify of global npm updates via Notification Center on Mac OS X Make sure the terminal notifier is installed. Install it wia `brew install terminal-notifier` command. The script assumes the **iTerm** is installed. Go get it, or edit the `npm-update-notifier.sh` for your need. 1. Put `npm-update-notifier.sh` to your `~/bin/` directory 2. Put `npm.npm.update-notifier.plist` to your `~/Library/LaunchAgents/` directory 3. Run `launchctl load ~/Library/LaunchAgents/npm.npm.update-notifier.plist` This script is run twice a day at 11 AM & 4 PM. Based on Based on Chris Streeters' `brew-update-notifier.sh` work from http://www.chrisstreeter.com This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,49 @@ #!/bin/bash # # Notify of npm updates via Notification Center on Mac OS X # # Author Csaba Maulis @_senki # Based on Chris Streeters' `brew-update-notifier.sh` (http://www.chrisstreeter.com) # Requires: terminal-notifier. Install with: # brew install terminal-notifier TERM_APP='/Applications/iTerm.app' NPM_EXEC='/usr/local/bin/npm' TERMINAL_NOTIFIER='/usr/local/bin/terminal-notifier' NOTIF_ARGS="-sender com.googlecode.iterm2 -activate com.googlecode.iterm2 -sound NotificationCenter" # Remove pinned package from the list of outdated package outdated=`$NPM_EXEC outdated -g | awk '{if (NR!=1) {print $1}}'` if [ -z "$outdated" ] ; then if [ -e $TERMINAL_NOTIFIER ]; then # No updates available $TERMINAL_NOTIFIER $NOTIF_ARGS \ -title "No npm Updates Available" \ -message "No updates available yet for any global npm(1) packages." fi else # We've got an outdated package or two # Nofity via Notification Center if [ -e $TERMINAL_NOTIFIER ]; then lc=$((`echo "$outdated" | wc -l`)) if [ $lc -gt 1 ]; then title="npm Updates Available" else title="An npm Update Available" fi outdated=`echo "$outdated" | tail -$lc` message=`echo "$outdated" | head -5` if [ "$outdated" != "$message" ]; then message="Some of the globally outdated package are: $message" else message="The following globally package are outdated: $message" fi # Send to the Nofication Center $TERMINAL_NOTIFIER $NOTIF_ARGS \ -title "$title" -message "$message" fi fi This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ <?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>EnableGlobbing</key> <false/> <key>Label</key> <string>npm.npm.update-notifier</string> <key>ProgramArguments</key> <array> <string>/bin/bash</string> <string>~/bin/npm-update-notifier.sh</string> </array> <key>StartInterval</key> <true/> <key>StandardErrorPath</key> <string>/tmp/npm.npm.update-notifier.err</string> <key>StandardOutPath</key> <string>/tmp/npm.npm.update-notifier.out</string> <key>StartCalendarInterval</key> <array> <dict> <key>Hour</key> <integer>11</integer> <key>Minute</key> <integer>0</integer> </dict> <dict> <key>Hour</key> <integer>16</integer> <key>Minute</key> <integer>0</integer> </dict> </array> </dict> </plist>