lib/utils.js
async function resolveExecutablePath (cmd) {
  let executablePath;
  try {
    executablePath = await fs.which(cmd);
    if (executablePath && await fs.exists(executablePath)) {
      return executablePath;
    }
  } catch (err) {
    if ((/not found/gi).test(err.message)) {
      log.debug(err);
    } else {
      log.warn(err);
    }
  }
  log.debug(`No executable path of '${cmd}'.`);
  if (executablePath) {
    log.debug(`Does '${executablePath}' exist?`);
  }
  return null;
}
async function resolveExecutablePath (cmd) {
  let executablePath;
  try {
    executablePath = await fs.which(cmd);
    if (executablePath && await fs.exists(executablePath)) {
      return executablePath;
    }
  } catch (err) {
    if ((/not found/gi).test(err.message)) {
      log.debug(err);
    } else {
      log.warn(err);
    }
  }
  log.debug(`No executable path of '${cmd}'.`);
  if (executablePath) {
    log.debug(`Does '${executablePath}' exist?`);
  }
  return null;
}
async function resolveExecutablePath ( cmd ) { let executablePath ; try { executablePath = await fs . which ( cmd ) ; if ( executablePath && await fs . exists ( executablePath ) ) { return executablePath ; } } catch ( err ) { if ( ( / not found / gi ) . test ( err . message ) ) { log . debug ( err ) ; } else { log . warn ( err ) ; } } log . debug ( ` ${ cmd } ` ) ; if ( executablePath ) { log . debug ( ` ${ executablePath } ` ) ; } return null ; }
Return an executable path of cmd

@param {string} cmd Standard output by command
@return {?string} The full path of cmd. `null` if the cmd is not found.
Return an executable path of cmd