function promisedExec(cmd, cwd) {
  return new Promise(function(resolve, reject) {
    const cmdLog = chalk.cyan(`$ ${cmd}`);
    gutil.log(' ', cmdLog);
    const execOptions = {
      cwd: cwd,
      maxBuffer: 1024 * 1024,
    };
    exec(cmd, execOptions, function(err, stdOut, stdErr) {
      stdOut = stdOut.trim();
      stdErr = stdErr.trim();
      if (err) {
        gutil.log(' ', cmdLog, chalk.red('FAILED'));
        reject(err);
        return;
      }
      gutil.log(' ', cmdLog, chalk.green('OK'));
      resolve(stdOut);
    });
  });
}
Executes a shell command and returns the result in a promise.

@param {string} cmd The command to run.
@param {string} cwd The working directory to run the command in.
@return {Promise} The promise that will be resolved on completion.