Skip to content

Commit

Permalink
Clean up publish script.
Browse files Browse the repository at this point in the history
  • Loading branch information
jheer committed May 22, 2015
1 parent 247f88c commit 6fbb86a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6fbb86a

Please sign in to comment.