Skip to content

Instantly share code, notes, and snippets.

@daftAnorak
Last active February 15, 2017 23:43
Show Gist options
  • Save daftAnorak/0d6767e1afb6d3db457c0e819288df04 to your computer and use it in GitHub Desktop.
Save daftAnorak/0d6767e1afb6d3db457c0e819288df04 to your computer and use it in GitHub Desktop.
Syncing the npm version to match the newly created pom file.
# !/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