From 75e37a5b364ace0042d70d2140fe6e1e0bf606bc Mon Sep 17 00:00:00 2001 From: Aaron Lichtman Date: Wed, 13 May 2020 07:46:35 -0500 Subject: [PATCH] Update release process --- scripts/release.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/release.sh b/scripts/release.sh index 49baf984..49c1ea1e 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,7 +1,18 @@ #!/bin/bash # Release script for shallow-backup -# Must be run from project root directory +# NOTE: Must be run from project root directory + +# Check if on master +BRANCH=$(git rev-parse --abbrev-ref HEAD) +if [[ "$BRANCH" != "master" ]]; then + echo 'Must be on master branch to cut a release!'; + exit 1; +fi + +# Check if master is dirty +[[ -z $(git status -s) ]] || echo 'Master branch dirty! Aborting.' && exit 1 + SB_VERSION="v$(python3 -c "from shallow_backup.constants import ProjInfo; print(ProjInfo.VERSION)")" SB_VERSION_NO_V="$(python3 -c "from shallow_backup.constants import ProjInfo; print(ProjInfo.VERSION)")"