Skip to content

Commit

Permalink
Update deploy script (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
mackode committed Sep 7, 2022
1 parent 7081dbf commit 4d2be7e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ if ! git diff-index --quiet HEAD --; then
fi

branch=`git rev-parse --abbrev-ref HEAD`
if [ "$branch" != "master" ]; then
echo "You need to be on master branch"
if [ "$branch" != "main" ]; then
echo "You need to be on main branch"
exit 0
fi

git fetch public master
git fetch public main
git fetch public --tags

master_rev=`git rev-parse origin/master`
local_master_rev=`git rev-parse HEAD`
main_rev=`git rev-parse origin/main`
local_main_rev=`git rev-parse HEAD`

if [ "$master_rev" != "$local_master_rev" ]; then
echo "Please sync your local repo with remote master"
if [ "$main_rev" != "$local_main_rev" ]; then
echo "Please sync your local repo with remote main"
exit 0
fi

Expand All @@ -40,7 +40,7 @@ npm run travis-build
node ./bin/makefile.js prepack
npm publish || { echo "Publishing failed" ; exit 0 ; }
node ./bin/makefile.js postpack
git push origin master
git push origin main
git push origin --tags

echo "Publish to npm DONE with $version ";
Expand Down

0 comments on commit 4d2be7e

Please sign in to comment.