Last active
August 29, 2015 14:04
-
-
Save tatac1/72dc043729c9a1732f13 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# 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