tasks/build_control.js
function gitCommit () {
      var message = options.message
        .replace(/%sourceName%/g, tokens.name)
        .replace(/%sourceCommit%/g, tokens.commit)
        .replace(/%sourceBranch%/g, tokens.branch);

      // If there are no changes, skip commit
      if (shelljs.exec('git status --porcelain', {silent: true}).output === '') {
        log.subhead('No changes to your branch. Skipping commit.');
        return;
      }

      log.subhead('Committing changes to "' + options.branch + '".');
      execWrap('git add -A .');

      // generate commit message
      var commitFile = 'commitFile-' + crypto.createHash('md5').update(message).digest('hex').substring(0, 6);
      fs.writeFileSync(commitFile, message);

      execWrap('git commit --file=' + commitFile);

      fs.unlinkSync(commitFile);
    }
function gitCommit () {
      var message = options.message
        .replace(/%sourceName%/g, tokens.name)
        .replace(/%sourceCommit%/g, tokens.commit)
        .replace(/%sourceBranch%/g, tokens.branch);

      // If there are no changes, skip commit
      if (shelljs.exec('git status --porcelain', {silent: true}).output === '') {
        log.subhead('No changes to your branch. Skipping commit.');
        return;
      }

      log.subhead('Committing changes to "' + options.branch + '".');
      execWrap('git add -A .');

      // generate commit message
      var commitFile = 'commitFile-' + crypto.createHash('md5').update(message).digest('hex').substring(0, 6);
      fs.writeFileSync(commitFile, message);

      execWrap('git commit --file=' + commitFile);

      fs.unlinkSync(commitFile);
    }
function gitCommit ( ) { var message = options . message . replace ( / %sourceName% / g , tokens . name ) . replace ( / %sourceCommit% / g , tokens . commit ) . replace ( / %sourceBranch% / g , tokens . branch ) ; // If there are no changes, skip commit if ( shelljs . exec ( 'git status --porcelain' , { silent : true } ) . output === '' ) { log . subhead ( 'No changes to your branch. Skipping commit.' ) ; return ; } log . subhead ( 'Committing changes to "' + options . branch + '".' ) ; execWrap ( 'git add -A .' ) ; // generate commit message var commitFile = 'commitFile-' + crypto . createHash ( 'md5' ) . update ( message ) . digest ( 'hex' ) . substring ( 0 , 6 ) ; fs . writeFileSync ( commitFile , message ) ; execWrap ( 'git commit --file=' + commitFile ) ; fs . unlinkSync ( commitFile ) ; }
Stage and commit to a branch
Stage and commit to a branch