Skip to content

Instantly share code, notes, and snippets.

@tatac1
Last active August 29, 2015 14:04
Show Gist options
  • Save tatac1/72dc043729c9a1732f13 to your computer and use it in GitHub Desktop.
Save tatac1/72dc043729c9a1732f13 to your computer and use it in GitHub Desktop.
#!/bin/sh
# switch ghc-7.6.3 or ghc-7.8.2
echo "Enter a ghcversion 7.6 or 7.8"
read VER
function changeGhc() {
# delete linked files
find $HOME/Library/Haskell -type l -exec rm {} \;
find $HOME/Library/Haskell/$ver -type f ! -name "*.*" -regex ".*/bin/.*" -exec ln -s {} $HOME/Library/Haskell/bin \;
}
case $VER in
7.6)
ver="ghc-7.6.3"
echo "switching ghc $ver .."
brew switch ghc 7.6.3_2
changeGhc
;;
7.8)
ver="ghc-7.8.2"
echo "switching ghc $ver .."
brew switch ghc 7.8.2_2
changeGhc
;;
*)
echo "Dose not exit such version $VER"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment