Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Chore/enforce-node-ver #555

Merged
merged 2 commits into from Aug 8, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions scripts/release.sh
Expand Up @@ -4,20 +4,26 @@ set -e # exit when error

printf "\nReleasing\n"

if [ "$(node -v)" != "v$(cat .nvmrc)" ]
then
printf "Release: Node version mismatch with .nvmrc (should be $(cat .nvmrc))\n"
exit 1
fi

if ! npm owner ls | grep -q "$(npm whoami)"
then
printf "Release: Not an owner of the npm repo, ask a contributor for access"
printf "Release: Not an owner of the npm repo, ask a contributor for access\n"
exit 1
fi

currentBranch=`git rev-parse --abbrev-ref HEAD`
if [ $currentBranch != 'master' ]; then
printf "Release: You must be on master"
printf "Release: You must be on master\n"
exit 1
fi

if [[ -n $(git status --porcelain) ]]; then
printf "Release: Working tree is not clean (git status)"
printf "Release: Working tree is not clean (git status)\n"
exit 1
fi

Expand Down