Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit a173c48

Browse files
committed
fix(build): added version option to bump script
1 parent 11dd017 commit a173c48

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

scripts/semantic-release/_bump.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,16 @@ bump_js()
6767
#
6868
prereqs()
6969
{
70-
merge_prereqs
71-
7270
if [ ! -s "$PACKAGE_JSON" -o ! -s "$BOWER_JSON" ]; then
7371
echo "*** Cannot locate $PACKAGE_JSON or $BOWER_JSON. Do not bump!"
7472
exit 1
7573
fi
7674

75+
# Version has been provided
76+
if [ -n "$VERSION" ]; then
77+
return
78+
fi
79+
7780
# Get version generated by 'semantic-release pre'
7881
VERSION=`grep '"version"' $PACKAGE_JSON | \
7982
awk -F':' '{print $2}' | \
@@ -124,14 +127,15 @@ cat <<- EEOOFF
124127
For PatternFly, the version number in $PTNFLY_SETTINGS_JS is bumped. For PatternFly and Angular PatternFly, the
125128
version number in $BOWER_JSON is bumped.
126129
127-
sh [-x] $SCRIPT [-h] -a|p
130+
sh [-x] $SCRIPT [-h] -a|p| -v <version>
128131
129-
Example: sh $SCRIPT -p
132+
Example: sh $SCRIPT -p -v 3.15.0
130133
131134
OPTIONS:
132135
h Display this message (default)
133136
a Angular PatternFly
134137
p PatternFly
138+
v The version number (e.g., 3.15.0)
135139
136140
EEOOFF
137141
}
@@ -151,13 +155,14 @@ verify()
151155
exit 1
152156
fi
153157

154-
while getopts hap c; do
158+
while getopts hapv: c; do
155159
case $c in
156160
h) usage; exit 0;;
157161
a) PTNFLY_ANGULAR=1;
158162
SWITCH=-a;;
159163
p) PTNFLY=1;
160164
SWITCH=-p;;
165+
v) VERSION=$OPTARG;;
161166
\?) usage; exit 1;;
162167
esac
163168
done

0 commit comments

Comments
 (0)