From 70b25be45ac318db445cffb2b91ecadc70ffeafa Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Tue, 13 Oct 2020 10:03:15 -0700 Subject: WIP: start installation script --- install.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 install.sh (limited to 'install.sh') diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..62e6892 --- /dev/null +++ b/install.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +set -u # error on use of undefined variable +set -e # exit on error + +# Install Haskell Stack to /usr/local/bin/stack +if command -v stack &> /dev/null ; then + echo "found stack" +else + curl -sSL https://get.haskellstack.org/ | sh +fi + + +# Check for Stack in /usr/local/bin/stack + +# On macOS, it might be necessary to run 'xcode-select --install' and/or +# 'open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg' +# to set up the Xcode command-line tools, which Stack uses. + +# Add '${USER}/.local/bin' the beginning of PATH in the fpm-setup.sh + +#cd boostrap +#stack install + +# Check for fpm in ${USER}/.local/bin -- cgit v1.2.3 From 6624b64631e3c56bd47b8d763b9ce7f9ef8ffa49 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Tue, 13 Oct 2020 11:41:07 -0700 Subject: add skeletal installer --- install.sh | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) (limited to 'install.sh') diff --git a/install.sh b/install.sh index 62e6892..cef50fc 100755 --- a/install.sh +++ b/install.sh @@ -3,23 +3,30 @@ set -u # error on use of undefined variable set -e # exit on error -# Install Haskell Stack to /usr/local/bin/stack 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 [[ -x "$install_path/stack" ]]; then + echo "Haskell stack installation successful." + else + echo "Haskell stack installation unsuccessful." + exit 1 + fi fi +install_path="$HOME/.local/bin" +if [[ -x "$install_path/fpm" ]]; then + echo "Overwriting existing fpm installation in $install_path" +fi -# Check for Stack in /usr/local/bin/stack - -# On macOS, it might be necessary to run 'xcode-select --install' and/or -# 'open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg' -# to set up the Xcode command-line tools, which Stack uses. - -# Add '${USER}/.local/bin' the beginning of PATH in the fpm-setup.sh - -#cd boostrap -#stack install +cd bootstrap +stack install -# Check for fpm in ${USER}/.local/bin +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 -- cgit v1.2.3 From 108a9973659b3c112f66e6246fa4a8fcf136a2af Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Tue, 13 Oct 2020 14:49:35 -0700 Subject: Update install.sh Co-authored-by: Brad Richardson --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'install.sh') diff --git a/install.sh b/install.sh index cef50fc..5029774 100755 --- a/install.sh +++ b/install.sh @@ -9,7 +9,7 @@ else echo "Haskell stack not found." echo "Installing Haskell stack to." curl -sSL https://get.haskellstack.org/ | sh - if [[ -x "$install_path/stack" ]]; then + if command -v stack &> /dev/null ; then echo "Haskell stack installation successful." else echo "Haskell stack installation unsuccessful." -- cgit v1.2.3 From e3319517b1d6b26fabb793ff0698f552e939d5e9 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Tue, 13 Oct 2020 18:08:57 -0700 Subject: fix(install.sh): define install_path earlier --- install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'install.sh') diff --git a/install.sh b/install.sh index 5029774..862de25 100755 --- a/install.sh +++ b/install.sh @@ -3,6 +3,8 @@ 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 @@ -17,7 +19,6 @@ else fi fi -install_path="$HOME/.local/bin" if [[ -x "$install_path/fpm" ]]; then echo "Overwriting existing fpm installation in $install_path" fi -- cgit v1.2.3