aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Richardson <everythingfunctional@protonmail.com>2020-10-27 14:13:16 -0500
committerGitHub <noreply@github.com>2020-10-27 14:13:16 -0500
commita22ce1c6b6921cbc86d0eca57256910fe8926439 (patch)
tree3e7e1b6209e43bc315a2ae68cc5dac9ca8906797
parent4443986b3d5690ce4ee8bbc348834caa2040be23 (diff)
parentcda71a0c7adb80128df53c9fdc4ae2030c5a17e8 (diff)
downloadfpm-a22ce1c6b6921cbc86d0eca57256910fe8926439.tar.gz
fpm-a22ce1c6b6921cbc86d0eca57256910fe8926439.zip
Merge pull request #206 from sourceryinstitute/installer
Add installation script in install.sh
-rwxr-xr-xinstall.sh33
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