Skip to content

Instantly share code, notes, and snippets.

@thiagobitencourt
Last active April 27, 2019 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thiagobitencourt/077dea574081cc810328d4143badc456 to your computer and use it in GitHub Desktop.
Save thiagobitencourt/077dea574081cc810328d4143badc456 to your computer and use it in GitHub Desktop.
Shell script function to get attribute from package.json file
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