puppeteer/tools/internal/util.ts
jrandolf 416d56b033
chore: refactor utils (#9053)
This PR

- renames the `utils` folder to `tools` (follows internal practice),
- migrates the contents of `scripts` into `tools` and removes scripts.
2022-10-06 10:27:14 +02:00

15 lines
305 B
TypeScript

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);
}
};