Created
February 13, 2018 16:54
-
-
Save tswaters/34e97c73d30dea6cffc49b6d590e881d to your computer and use it in GitHub Desktop.
Add tags to git repo based on npm view output
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
for version in $(npm view $1 --json | jq '.versions[]' -c -r); do | |
sha=$(npm view $1@$version --json | jq '.gitHead' -c -r) | |
echo Tagging $sha as v$version | |
git tag -a "v$version" $sha -m "Release v$version" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment