Last active
February 15, 2017 23:43
-
-
Save daftAnorak/0d6767e1afb6d3db457c0e819288df04 to your computer and use it in GitHub Desktop.
Syncing the npm version to match the newly created pom file.
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 | |
pomVersion=`cat pom.xml \ | |
| grep '^ <version>.*</version>$' \ | |
| awk -F'[><]' '{print $3}' \ | |
| sed 's/-SNAPSHOT//'` | |
npmVersion=`cat package.json \ | |
| grep version \ | |
| head -1 \ | |
| awk -F: '{ print $2 }' \ | |
| sed 's/[",]//g'` | |
if [ $pomVersion != $npmVersion ]; then | |
echo "Bumping npm version to $pomVersion and staging for commit ..." | |
npm version $pomVersion --no-git-tag-version | |
git add -- package.json | |
git commit -m "Syncing NPM version to POM version" -- package.json | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment