Created
October 25, 2013 19:02
-
-
Save mxey/7160040 to your computer and use it in GitHub Desktop.
This file contains 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 characters
<?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>net.mxey.homebrew.upgrade</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/Users/mxey/bin/upgrade-homebrew-on-ac</string> | |
</array> | |
<key>StartInterval</key> | |
<integer>46800</integer> | |
</dict> | |
</plist> |
This file contains 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 characters
#!/bin/zsh -e | |
if system_profiler SPPowerDataType | fgrep -q "Connected: No"; then | |
echo On battery power, not running | |
exit 0 | |
fi | |
terminal-notifier -message "Upgrading your Homebrew packages" | |
if brew update && brew upgrade && brew cleanup; then | |
terminal-notifier -message "Homebrew was upgraded" | |
else | |
terminal-notifier -message "Homebrew upgrades failed" | |
fi% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment