Skip to content

Commit

Permalink
Make postversion script a bit more intelligent
Browse files Browse the repository at this point in the history
  • Loading branch information
fatso83 committed Aug 17, 2023
1 parent c85ef14 commit fc312b9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/postversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ cd $SCRIPT_DIR > /dev/null
set -e

# check that that origin points to the sinonjs/fake-timers repo
git remote -v | grep 'origin.*sinonjs/fake-timers.*push' > /dev/null
UPSTREAM=$(git config branch.main.remote)
git config "remote.$UPSTREAM.url" | grep '.*sinonjs/fake-timers' > /dev/null

if [[ $? != 0 ]]; then
echo "'origin' doesn't point to the sinonjs/fake-timers repo. Fix tag push manually!"
echo "'$UPSTREAM' doesn't point to the sinonjs/fake-timers repo. Fix tag push manually!"
exit 1
fi

git push --follow-tags origin
git push --follow-tags $UPSTREAM

cd .. # to root dir
npm publish

0 comments on commit fc312b9

Please sign in to comment.