-
-
Save Sylvain-Bugat/f6ffad0eab34394159fb to your computer and use it in GitHub Desktop.
Extract version from package.json (NPM) using bash / shell / awk
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
# One command version using awk | |
PACKAGE_VERSION=$( awk -F: '$1 ~ /"version"/ { split($2,array,"\""); print array[2] ; exit }' package.json ) | |
echo "${PACKAGE_VERSION}" |
4F2E4A2E
commented
Apr 14, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment