async function yarnRun()

in packages/web-scripts/src/Tasks/AuditTasks/index.ts [59:82]


async function yarnRun(task: AuditTaskDesc): Promise<string> {
  const cmd = 'npx';
  const { threshold } = task;

  const args = [
    '--no-install',
    'yarn',
    'audit',
    '--cwd',
    CONSUMING_ROOT,
    ...task.restOptions,
  ];
  dbg('npx args %o', args);

  try {
    await spawn(cmd, args, { stdio: 'inherit' });
  } catch (err) {
    const thresholdReached =
      (err as any).exitStatus >= ThresholdLimits[threshold];
    if (thresholdReached) process.exit((err as any).exitStatus);
  }

  return '';
}