Created
April 4, 2016 21:33
-
-
Save aphex3k/1cfc32b88fd05ba39c77e4a92408732f to your computer and use it in GitHub Desktop.
Backup current installed cask list to gist
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 characters
| #!/bin/sh | |
| gistId=8fe981c9d3696fe97955ebea7cc3e0f2 | |
| gistOld=/tmp/gist-restore.old | |
| gistCurrent=/tmp/gist-restore.current | |
| if [ -f "${gistOld}" ] | |
| then | |
| rm "${gistOld}" | |
| fi | |
| if [ -f "${gistCurrent}" ] | |
| then | |
| rm "${gistCurrent}" | |
| fi | |
| gist -r ${gistId} > /tmp/gist-restore.old | |
| brew cask list > /tmp/gist-restore.current | |
| diff -w -B -a -q /tmp/gist-restore.old /tmp/gist-restore.current >/dev/null | |
| if [ ! "0$?" -eq "00" ] | |
| then | |
| gist -u "${gistId}" "${gistCurrent}" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment