From 9695b4abfeffe0b5a3b820896a7feecf613f7472 Mon Sep 17 00:00:00 2001 From: Andrew Miner Date: Fri, 29 May 2015 13:53:06 -0700 Subject: [PATCH] Update publish script to use `read` correctly --- scripts/publish | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/publish b/scripts/publish index 95143ab37..f2a0b5a87 100755 --- a/scripts/publish +++ b/scripts/publish @@ -1,15 +1,19 @@ #!/bin/bash +function die { + echo $* + exit 1 +} + git checkout production \ && git rebase master \ && git push \ && git checkout master - -read VERSION_TYPE -p "Major, minor, patch? " +read -p "Major, minor, patch? " VERSION_TYPE if [[ "$VERSION_TYPE" == "" ]]; then exit 1 fi -npm version "$VERSION_TYPE" +npm version "$VERSION_TYPE" || die "Invalid version type: $VERSION_TYPE" npm publish