From db294837294c4f90eaed378e2f80a44bae043537 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 22 Oct 2019 21:30:44 +1100 Subject: [PATCH] Check if the version is empty in manage.sh (#1268) If someone accidentally hits Enter when prompted for the new version, the script merrily creates a tag called 'v', which is bothersome to tidy up. Check if the variable is empty and error if it is. --- manage.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/manage.sh b/manage.sh index 404acd11..a166e3b7 100755 --- a/manage.sh +++ b/manage.sh @@ -33,6 +33,10 @@ function bump { previousVersion=$( grep '^version =' setup.py | sed 's/version = \"\(.*\)\"/\1/' ) echo "Next version number? (previous: '$previousVersion')" read version + if [ -z "$version" ]; then + echo "empty version string" + exit 1 + fi sed -i -b "s/version = .*/version = \"$version\"/" setup.py }