Accept additional args when publishing

This commit is contained in:
Tim Schaub
2019-08-07 00:01:57 -04:00
parent dec44a7202
commit d59eed5d3b

View File

@@ -23,7 +23,7 @@ REMOTE=https://github.com/openlayers/openlayers.git
display_usage() { display_usage() {
cat <<-EOF cat <<-EOF
Usage: ${1} <version> Usage: ${1} <version> [options]
To publish a new release, update the version number in package.json and To publish a new release, update the version number in package.json and
create a tag for the release. create a tag for the release.
@@ -33,6 +33,8 @@ display_usage() {
The tag must be pushed to ${REMOTE} before the release can be published. The tag must be pushed to ${REMOTE} before the release can be published.
Additional args afer <version> will be passed to "npm publish" (e.g. "--tag beta").
EOF EOF
} }
@@ -76,12 +78,13 @@ main() {
npm install npm install
npm run build-package npm run build-package
cd ${BUILT_PACKAGE} cd ${BUILT_PACKAGE}
npm publish shift
npm publish ${@}
} }
if test ${#} -ne 1; then if test ${#} -lt 1; then
display_usage ${0} display_usage ${0}
exit 1 exit 1
else else
main ${1} main ${@}
fi fi