summaryrefslogtreecommitdiffstats
path: root/remote/test/puppeteer/tools/internal/util.ts
blob: 4ebbe8b86b9d09ed1fc5a787f8354f011eb2f1cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import {spawnSync} from 'child_process';

export const spawnAndLog = (...args: string[]): void => {
  const {stdout, stderr} = spawnSync(args[0]!, args.slice(1), {
    encoding: 'utf-8',
    shell: true,
  });
  if (stdout) {
    console.log(stdout);
  }
  if (stderr) {
    console.error(stderr);
  }
};