Skip to content

Commit a22ce1c

Browse files
Merge pull request #206 from sourceryinstitute/installer
Add installation script in install.sh
2 parents 4443986 + cda71a0 commit a22ce1c

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

install.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/bin/sh
2+
3+
set -u # error on use of undefined variable
4+
set -e # exit on error
5+
6+
install_path="$HOME/.local/bin"
7+
8+
if command -v stack &> /dev/null ; then
9+
echo "found stack"
10+
else
11+
echo "Haskell stack not found."
12+
echo "Installing Haskell stack to."
13+
curl -sSL https://get.haskellstack.org/ | sh
14+
if command -v stack &> /dev/null ; then
15+
echo "Haskell stack installation successful."
16+
else
17+
echo "Haskell stack installation unsuccessful."
18+
exit 1
19+
fi
20+
fi
21+
22+
if [[ -x "$install_path/fpm" ]]; then
23+
echo "Overwriting existing fpm installation in $install_path"
24+
fi
25+
26+
cd bootstrap
27+
stack install
28+
29+
if [[ -x "$install_path/fpm" ]]; then
30+
echo "fpm installed successfully to $install_path"
31+
else
32+
echo "fpm installation unsuccessful: fpm not found in $install_path"
33+
fi

0 commit comments

Comments
 (0)