Skip to content

Instantly share code, notes, and snippets.

@kigster
Last active May 27, 2016 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kigster/764068df3ca4bcc580566a3bf4f6d7f3 to your computer and use it in GitHub Desktop.
Save kigster/764068df3ca4bcc580566a3bf4f6d7f3 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
#
# (c) 2015-2016 Shippo Inc.
# Author: Konstantin Gredeskoul, kig@reinvent.one
# http://reinvent.one
#
# Run via http://sw.im/shippo
#
# This bootstrap script is supposed to be run as follows:
# curl -fsSL 'http://sw.im/shippo' | /usr/bin/env bash
dir="dev-install"
script="install"
script_flags=""
repo="git@bitbucket.org:shippotle/${dir}.git"
ws="${HOME}/workspace"
function bootstrap {
mkdir -p ${ws}
cd ${ws}
if [[ ! -d "${ws}/${dir}" ]]; then
echo "doing git pull of ${dir} project..."
git clone ${repo} ${dir}
fi
if [[ -d "${ws}/${dir}" ]]; then
pushd "${ws}/${dir}"
git pull --rebase origin pullulant
[[ -x "${ws}/${dir}/${script}" ]] || {
echo "can't find script ${ws}/${dir}/${script}"
exit 1
}
./${script} ${script_flags} $*
else
echo "Can't find '${dir}' folder – perhaps your git isn't setup?"
fi
}
bootstrap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment