Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an option to skip the installation of Keter #186

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions setup-keter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,39 @@ set -o errexit -o nounset -o xtrace
# Quick start:
# wget -O - https://raw.github.com/snoyberg/keter/master/setup-keter.sh | bash -ex

LSB_RELEASE=$(lsb_release -sc)
# If you're using your own Keter binary, you can skip the installation of keter by passing in -s as a parameter
# wget -O - https://raw.github.com/snoyberg/keter/master/setup-keter.sh | bash -exs - -s

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 575159689BEFB442
echo "deb http://download.fpcomplete.com/ubuntu \"${LSB_RELEASE}\" main"|sudo tee /etc/apt/sources.list.d/fpco.list
# A POSIX variable
OPTIND=1 # Reset in case getopts has been used previously in the shell.

sudo apt-get update
sudo apt-get -y install postgresql stack zlib1g-dev
# Initialize our own variables:
skip_install=0

stack update
stack setup
stack install keter
while getopts "s" opt; do
case "$opt" in
s) skip_install=1
;;
esac
done

shift $((OPTIND-1))

[ "${1:-}" = "--" ] && shift

if [ "$skip_install" -eq 0 ]; then
LSB_RELEASE=$(lsb_release -sc)

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 575159689BEFB442
echo "deb http://download.fpcomplete.com/ubuntu \"${LSB_RELEASE}\" main"|sudo tee /etc/apt/sources.list.d/fpco.list

sudo apt-get update
sudo apt-get -y install postgresql stack zlib1g-dev

stack update
stack setup
stack install keter
fi

sudo mkdir -p /opt/keter/bin
sudo cp ~/.local/bin/keter /opt/keter/bin
Expand Down