Skip to content

Commit df8185f

Browse files
committed
build: add skip-versioning option for release tool
Allow change the `CHANGELOG.md`
1 parent 339293d commit df8185f

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

tools/release.sh

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
set -eu
1616

17-
opt_pre=false # preview mode option
17+
opt_pre=false # preview mode option
18+
opt_skip_ver=false # option for skip versioning
1819

1920
working_branch="$(git branch --show-current)"
2021

@@ -48,6 +49,7 @@ help() {
4849
echo " bash ./tools/release.sh [options]"
4950
echo
5051
echo "Options:"
52+
echo " -k, --skip-versioning Skip the step of generating the version number."
5153
echo " -p, --preview Enable preview mode, only package, and will not modify the branches"
5254
echo " -h, --help Print this information."
5355
}
@@ -170,13 +172,15 @@ release() {
170172
}
171173

172174
main() {
173-
check
174-
175-
# auto-generate a new version number to the file 'package.json'
176-
if $opt_pre; then
177-
standard-version --prerelease rc
178-
else
179-
standard-version
175+
if [[ $opt_skip_ver = false ]]; then
176+
check
177+
178+
# auto-generate a new version number to the file 'package.json'
179+
if $opt_pre; then
180+
standard-version --prerelease rc
181+
else
182+
standard-version
183+
fi
180184
fi
181185

182186
_version="$(grep '"version":' package.json | sed 's/.*: "//;s/".*//')"
@@ -201,6 +205,10 @@ while (($#)); do
201205
opt_pre=true
202206
shift
203207
;;
208+
-k | --skip-versioning)
209+
opt_skip_ver=true
210+
shift
211+
;;
204212
-h | --help)
205213
help
206214
exit 0

0 commit comments

Comments
 (0)