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.
This commit is contained in:
Steve Kowalik
2019-10-22 21:30:44 +11:00
committed by GitHub
parent bc225f9d11
commit db29483729
+4
View File
@@ -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
}