code: function execute(cmd) {
    var result = promise.defer();
    exec(cmd, function(err, stdout) {
      if (err) {
        result.reject(err);
      } else {
        result.fulfill(stdout);
      }
    });
    return result.promise;
  }
docs: Executes a command and returns its output if it succeeds.
  @param {string} cmd The command to execute.
  @return {!webdriver.promise.Promise.<string>} A promise that will resolve
  with the command's stdout data.