I have a simple function here to get the git ID (just for testing purposes). I don't understand how to set the variable when evaluating it from top to bottom. It is giving me undefined.
var gitID;
require ('child_process').exec ('git rev-parse HEAD', function (err, stdout) {
gitID = stdout;
});
console.log (gitID);
How do I set the variable at the top of my js file to be the git ID?