tasks/build_control.js
function assignTokens () {
      var sourceBranch = shelljs.exec('git rev-parse --abbrev-ref HEAD', {silent: true});
      var sourceCommit = shelljs.exec('git rev-parse --short HEAD', {silent: true});

      if (sourceBranch.code === 0) {
        tokens.branch = sourceBranch.output.replace(/\n/g, '');
      }
      if (sourceCommit.code === 0) {
        tokens.commit = sourceCommit.output.replace(/\n/g, '');
      }
      if (shelljs.test('-f', 'package.json', {silent: true})) {
        tokens.name = JSON.parse(fs.readFileSync('package.json', 'utf8')).name;
      }
      else {
        tokens.name = process.cwd().split('/').pop();
      }
    }
function assignTokens () {
      var sourceBranch = shelljs.exec('git rev-parse --abbrev-ref HEAD', {silent: true});
      var sourceCommit = shelljs.exec('git rev-parse --short HEAD', {silent: true});

      if (sourceBranch.code === 0) {
        tokens.branch = sourceBranch.output.replace(/\n/g, '');
      }
      if (sourceCommit.code === 0) {
        tokens.commit = sourceCommit.output.replace(/\n/g, '');
      }
      if (shelljs.test('-f', 'package.json', {silent: true})) {
        tokens.name = JSON.parse(fs.readFileSync('package.json', 'utf8')).name;
      }
      else {
        tokens.name = process.cwd().split('/').pop();
      }
    }
function assignTokens ( ) { var sourceBranch = shelljs . exec ( 'git rev-parse --abbrev-ref HEAD' , { silent : true } ) ; var sourceCommit = shelljs . exec ( 'git rev-parse --short HEAD' , { silent : true } ) ; if ( sourceBranch . code === 0 ) { tokens . branch = sourceBranch . output . replace ( / \n / g , '' ) ; } if ( sourceCommit . code === 0 ) { tokens . commit = sourceCommit . output . replace ( / \n / g , '' ) ; } if ( shelljs . test ( '-f' , 'package.json' , { silent : true } ) ) { tokens . name = JSON . parse ( fs . readFileSync ( 'package.json' , 'utf8' ) ) . name ; } else { tokens . name = process . cwd ( ) . split ( '/' ) . pop ( ) ; } }
Assign %token% values if available
Assign %token% values if available