Last active
December 27, 2015 04:09
-
-
Save netmilk/7264553 to your computer and use it in GitHub Desktop.
Oneliner used to find version bumps in package.json and output commands for tagging particular commits
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
#!/bin/bash | |
for i in `git log package.json | grep -e "^commit" | awk '{print $2}'`; do git diff $i^1 $i package.json 2>/dev/null | grep -e "\+ \"version\"" | sed s/,// | xargs echo $i | awk '{print "git tag -a v" $4 " " $1 " -m \"Bumped to version " $4 "\"" }'; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment