Created
February 1, 2018 07:07
-
-
Save kakkun61/6d6c48ff0891c8bd705c436a96727e4b 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
#!/usr/bin/env bash | |
set -e | |
GCC_PATH=/usr/local/bin/gcc | |
usage() { | |
echo "$(basename $0) [fsf/apple]" >&2 | |
} | |
if [[ $# -ne 1 ]] | |
then | |
usage | |
exit 1 | |
fi | |
if [[ -L $GCC_PATH ]] | |
then | |
rm $GCC_PATH | |
fi | |
case "$1" in | |
fsf) | |
ln -s /usr/local/bin/gcc-7 $GCC_PATH | |
exit 0 | |
;; | |
apple) | |
ln -s /usr/bin/gcc $GCC_PATH | |
exit 0 | |
;; | |
esac | |
echo 'bad parameter' >&2 | |
exit 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment