Allow version passed to update_version.sh to start with "version-" prefix

This allows you to copy-paste a tag and edit it for the new version.
This commit is contained in:
Sybren A. Stüvel 2017-03-21 14:16:07 +01:00
parent ec72091268
commit 7c65851b75

View File

@ -1,13 +1,15 @@
#!/bin/bash
if [ -z "$1" ]; then
VERSION="${1/version-}"
if [ -z "$VERSION" ]; then
echo "Usage: $0 new-version" >&2
exit 1
fi
BL_INFO_VER=$(echo "$1" | sed 's/\./, /g')
BL_INFO_VER=$(echo "$VERSION" | sed 's/\./, /g')
sed "s/version='[^']*'/version='$1'/" -i setup.py
sed "s/version='[^']*'/version='$VERSION'/" -i setup.py
sed "s/'version': ([^)]*)/'version': ($BL_INFO_VER)/" -i blender_cloud/__init__.py
git diff