Last active
April 27, 2019 13:22
-
-
Save thiagobitencourt/077dea574081cc810328d4143badc456 to your computer and use it in GitHub Desktop.
Shell script function to get attribute from package.json file
This file contains hidden or 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
get_attribute() { cat package.json | grep $1 | head -1 | cut -d ":" -f 2 | sed "s/[{, }, \", ',[:space:]]//g"; }; | |
project=$(get_attribute "name\""); | |
echo $project |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment