1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
#!/usr/bin/env bash
set -e
function cleanup {
echo -n ''
}
trap cleanup EXIT
function fail_hard {
echo "$1"
exit 1
}
make=$(which gmake &>/dev/null && echo "gmake" || echo "make")
sbws_repo="$(realpath $1)"
venv="$sbws_repo/venv"
[ -d "$venv" ] || fail_hard "$venv doesn't exist"
[ ! -z "$sbws_repo" ] || fail_hard "$0 <sbws_repo>"
[ -d "$sbws_repo" ] || fail_hard "$sbws_repo doesn't exist"
pushd "$sbws_repo"
git pull
source "$venv/bin/activate"
pip install -U --upgrade-strategy eager .[doc]
pushd docs
$make html
popd
|