Skip to content

Instantly share code, notes, and snippets.

@buitcj
buitcj / mvn-project-version.sh
Created June 13, 2018 14:14 — forked from loverdos/mvn-project-version.sh
Get maven project version from the shell
mvn help:evaluate -Dexpression=project.version | grep -e '^[^\[]'
@buitcj
buitcj / get-npm-package-version
Created June 13, 2018 14:13 — forked from DarrenN/get-npm-package-version
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION