Skip to content

Commit a2fc3bf

Browse files
committed
Enhanced script to accept version number argument.
1 parent cf21231 commit a2fc3bf

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

set_version

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
11
#!/bin/sh --
2+
#
3+
# This script sets version number entries in various files in the BlocklyPropClient project.
4+
#
5+
# Usage: $ ./set_version 1.2.3
6+
7+
#
8+
# Error if no version string declared
9+
#
10+
if [ $1X == X ]
11+
then
12+
echo "ERROR: Must specify a version number. Ex: \$ $0 1.2.3"
13+
exit 1
14+
fi
15+
16+
17+
#
18+
# Get version string
19+
#
20+
VERSION=$1
21+
222

323
#
424
# FindAndSetVersion function
@@ -13,15 +33,13 @@
1333
function FindAndSetVersion {
1434
if grep -q -E ${VERSIONPATTERN} ${VERSIONFILE} ; then
1535
if sed -i.bak -E "s/${VERSIONPATTERN}/${VERSIONSTRING}/" ${VERSIONFILE} ; then
16-
echo "Updated file \"${VERSIONFILE}\" to include \"${VERSIONSTRING}\""
36+
echo "Updated file \"${VERSIONFILE}\" to include: ${VERSIONSTRING}"
1737
fi
1838
else
1939
echo "ERROR: Unable to find version string in file \"${VERSIONFILE}\""
2040
fi
2141
}
2242

23-
VERSION=0.5.3
24-
2543
#
2644
# Adjust BlocklyPropClient.py file
2745
#

0 commit comments

Comments
 (0)