From bb250543bce25a6e116f2a8c7b5a4a8b2efcf842 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Mon, 5 Jun 2017 12:11:15 +0100 Subject: [PATCH] add sleep time flag in publish script --- scripts/npm-publish.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/npm-publish.sh b/scripts/npm-publish.sh index fe10c3f3c8..934ce92876 100755 --- a/scripts/npm-publish.sh +++ b/scripts/npm-publish.sh @@ -9,6 +9,8 @@ eval TOKEN_REGISTRY="" eval OPTIONS="" eval EXEC_GIT_NPM_INSTALL_JSAPI=false eval GIT_ISH="" +eval EXEC_SLEEP=false +eval SLEEP_TIME="0" cd "$DIR/../demo-shell-ng2" @@ -19,6 +21,7 @@ show_help() { echo "-r or -registry to publish in an alternative npm registry -registry 'http://npm.local.me:8080/' " echo "-token auth token for publish in the npm registry" echo "-t or -tag to add a tag when publish a package" + echo "--sleep add a sleep before any publish" echo "-gitjsapi to build all the components against a commit-ish version of the JS-API" } @@ -31,6 +34,11 @@ enable_change_registry(){ EXEC_CHANGE_REGISTRY=true } +set_sleep(){ + SLEEP_TIME=$1 + EXEC_SLEEP=true +} + get_token_registry(){ TOKEN_REGISTRY=$1 @@ -79,6 +87,7 @@ while [[ $1 == -* ]]; do -t|--tag) add_tag $2; shift 2;; -f|--force) enable_force; shift;; -token) get_token_registry $2; shift 2;; + --sleep) set_sleep $2; shift 2;; -r|--registry) enable_change_registry $2; shift 2;; -gitjsapi) enable_js_api_git_link $2; shift 2;; -*) echo "invalid option: $1" 1>&2; show_help; exit 0;; @@ -132,5 +141,10 @@ do npm run rimraf .npmrc fi + if $EXEC_SLEEP == true; then + echo "====== SLEEP ${SLEEP_TIME}" + sleep ${SLEEP_TIME} + fi + cd ${DIR} done