浏览代码

build param for version scope

Adam Shaw 7 年之前
父节点
当前提交
e4d06608fe
共有 1 个文件被更改,包括 8 次插入4 次删除
  1. 8 4
      bin/publish-release.sh

+ 8 - 4
bin/publish-release.sh

@@ -15,6 +15,13 @@ then
   exit 1
 fi
 
+read -p "Enter a version scope (latest/beta/alpha): " scope
+if [[ "$scope" != "latest" ]] && [[ "$scope" != "beta" ]] && [[ "$scope" != "alpha" ]]
+then
+  echo "Invalid scope '$scope'. Aborting."
+  exit 1
+fi
+
 # push the current branch (assumes tracking is set up) and the tag
 git push --recurse-submodules=on-demand
 git push origin "v$version"
@@ -25,11 +32,8 @@ success=0
 current_branch=$(git symbolic-ref --quiet --short HEAD)
 
 # temporarily checkout the tag's commit, publish to NPM
-echo
-echo 'NOTE!!! publishing with "alpha" tag (whereas default is "latest")'
-echo
 git checkout --quiet "v$version"
-if npm publish --tag alpha
+if npm publish --tag "$scope"
 then
   success=1
 fi