Created
September 29, 2015 17:06
-
-
Save blacktaxi/f774bd33ddd2ca7864e9 to your computer and use it in GitHub Desktop.
stack bootstrapper
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/bash | |
which stack > /dev/null | |
if [ $? -ne 0 ]; then | |
if [ ! -f ./.stack/stack ]; then | |
OS=`uname` | |
if [ $OS == "Darwin" ]; then | |
STACK_URL=https://github.com/commercialhaskell/stack/releases/download/v0.1.3.1/stack-0.1.3.1-x86_64-osx.gz | |
elif [ $OS == "Linux" ]; then | |
STACK_URL=https://github.com/commercialhaskell/stack/releases/download/v0.1.3.1/stack-0.1.3.1-x86_64-linux.gz | |
else | |
echo "The OS $OS is not supported." | |
exit 1 | |
fi | |
echo "Downloading stack..." | |
mkdir -p .stack | |
touch ./.stack/stack | |
wget -qO- $STACK_URL --no-check-certificate | gunzip -dc > ./.stack/stack | |
if [ $? -ne 0 ]; then | |
echo Could not download stack. | |
rm -f ./.stack/stack | |
exit 1 | |
fi | |
chmod a+x ./.stack/stack | |
fi | |
./.stack/stack $* | |
else | |
stack $* | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment