Skip to content

Instantly share code, notes, and snippets.

@netmilk
Last active December 27, 2015 04:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save netmilk/7264553 to your computer and use it in GitHub Desktop.
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
#!/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