Skip to content

Commit

Permalink
revert-lerna-publish script to delete tags and commit (#2482)
Browse files Browse the repository at this point in the history
* revert-lerna-publish script to delete tags and commit

* fix exit condition
  • Loading branch information
giladgray committed May 10, 2018
1 parent 0c321d2 commit 93ba2cf
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scripts/revert-lerna-publish
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash

# Run this script after a botched `lerna publish` to delete all tags
# and the "Publish" commit created by Lerna. Requires confirmation.

read -p "⚠️ Delete lerna publish commit and tags? [y/N] " response
if [[ ! $response =~ ^(yes|y)$ ]]; then
exit
fi

# delete all tags created by Lerna
for tag in $(git tag --points-at HEAD); do
git tag -d $tag
done

# undo Lerna commit
git reset --hard HEAD^

1 comment on commit 93ba2cf

@blueprint-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

revert-lerna-publish script to delete tags and commit (#2482)

Preview: documentation | landing | table

Please sign in to comment.