Created
July 9, 2016 15:57
-
-
Save nikolay/898da8cf96058b339f6fabdc590e4b84 to your computer and use it in GitHub Desktop.
Migrate Caskroom
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
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