diff options
Diffstat (limited to 'install.sh')
-rwxr-xr-x | install.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..862de25 --- /dev/null +++ b/install.sh @@ -0,0 +1,33 @@ +#!/bin/sh + +set -u # error on use of undefined variable +set -e # exit on error + +install_path="$HOME/.local/bin" + +if command -v stack &> /dev/null ; then + echo "found stack" +else + echo "Haskell stack not found." + echo "Installing Haskell stack to." + curl -sSL https://get.haskellstack.org/ | sh + if command -v stack &> /dev/null ; then + echo "Haskell stack installation successful." + else + echo "Haskell stack installation unsuccessful." + exit 1 + fi +fi + +if [[ -x "$install_path/fpm" ]]; then + echo "Overwriting existing fpm installation in $install_path" +fi + +cd bootstrap +stack install + +if [[ -x "$install_path/fpm" ]]; then + echo "fpm installed successfully to $install_path" +else + echo "fpm installation unsuccessful: fpm not found in $install_path" +fi |