Skip to content

Instantly share code, notes, and snippets.

@nikolay
Created July 9, 2016 15:57
Show Gist options
  • Save nikolay/898da8cf96058b339f6fabdc590e4b84 to your computer and use it in GitHub Desktop.
Save nikolay/898da8cf96058b339f6fabdc590e4b84 to your computer and use it in GitHub Desktop.
Migrate Caskroom
main () {
local file
local old_location
for file in $HOME/Applications/*.app; do
if [[ -e "$file" ]]; then
old_location="$(readlink "$file")"
if [[ -e $old_location ]] \
&& [[ $old_location == /opt/homebrew-cask/Caskroom/* ]]; then
ln -sf "/usr/local${old_location#/opt/homebrew-cask}" "$file"
fi
fi
done
mv "/opt/homebrew-cask/Caskroom" "/usr/local"
}
main "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment