Skip to content

Instantly share code, notes, and snippets.

@keif
Created April 6, 2016 02:14
Show Gist options
  • Save keif/f02b38ed3b1758486880fc5160a3e828 to your computer and use it in GitHub Desktop.
Save keif/f02b38ed3b1758486880fc5160a3e828 to your computer and use it in GitHub Desktop.
weather() {
# ?u/m for changing metrics
curl "http://wttr.in/${1-}";
echo "weather [CITY/ZIP]";
}
moon() {
curl "http://wttr.in/moon${1-}";
echo "moon [@dateYYYY-MMM-DD]"
}
brew_cask_upgrade() {
if [ "$1" != '--continue' ]; then
echo "Removing brew cache"
rm -rf "$(brew --cache)"
echo "Running brew update"
brew update
fi
for c in $(brew cask list); do
echo -e "\n\nInstalled versions of $c: "
ls /opt/homebrew-cask/Caskroom/$c
echo "Cask info for $c"
brew cask info $c
echo "Install new version?"
select ynx in "Yes" "No" "Exit"; do
case $ynx in
"Yes") echo "Uninstalling $c"; brew cask uninstall --force "$c"; echo "Re-installing $c"; brew cask install "$c" --appdir="/Applications/"; break;;
"No") echo "Skipping $c"; break;;
"Exit") echo "Exiting brew-cask-upgrade"; return;;
esac
done
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment