Skip to content

Instantly share code, notes, and snippets.

@catdad
Created August 11, 2017 15:47
Show Gist options
  • Save catdad/6bf1069e76b164bb8677b4a13db9bee3 to your computer and use it in GitHub Desktop.
Save catdad/6bf1069e76b164bb8677b4a13db9bee3 to your computer and use it in GitHub Desktop.
Use node to parse some json from a bash script
BUILD_NUMBER=`node <<- EOM
var fs = require('fs');
var file = JSON.parse(fs.readFileSync('./file.json', 'utf8'));
process.stdout.write(file.displayName);
EOM`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment