From 6fbb86a6012f3291c08111acda5db5a9541c1f52 Mon Sep 17 00:00:00 2001 From: Jeffrey Heer Date: Fri, 22 May 2015 09:32:15 -0700 Subject: [PATCH] Clean up publish script. --- publish.sh | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/publish.sh b/publish.sh index cb0de13..5adff8d 100755 --- a/publish.sh +++ b/publish.sh @@ -3,30 +3,26 @@ RED='\033[0;31m' NC='\033[0m' # No Color # 0.1 Check if jq has been installed -type jq >/dev/null 2>&1 || { echo >&2 "I require jq but it's not installed. Aborting."; exit 1; } +type jq >/dev/null 2>&1 || { echo >&2 "I require jq but it's not installed. Aborting."; exit 1; } # 0.2 Check if all files are commited if [ -z "$(git status --porcelain)" ]; then - echo "All tracked files are commited. Publishing on npm and bower. \n" + echo "All tracked files are commited. Publishing on npm and bower." else - echo "${RED}There are uncommitted files. Please commit or stash first!${NC} \n\n" + echo "${RED}There are uncommitted files. Please commit or stash first!${NC}" git status exit 1 fi - - # 1. NPM PUBLISH npm publish # exit if npm publish failed rc=$? if [[ $rc != 0 ]]; then - echo "${RED} npm publish failed. Publishing cancelled. ${NC} \n\n" + echo "${RED} npm publish failed. Publishing cancelled. ${NC}" exit $rc; fi - - # 2. BOWER PUBLISH # read version gitsha=$(git rev-parse HEAD)