0
0
mirror of https://github.com/renovatebot/renovate.git synced 2024-12-22 05:28:35 +00:00
renovatebot_renovate/tools/utils/exec.ts
Michael Kriese d90de484b1
docs: validate with mkdocs (#30735)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2024-08-14 10:42:23 +00:00

22 lines
436 B
TypeScript

import {
type SpawnSyncOptions,
type SpawnSyncReturns,
spawnSync,
} from 'node:child_process';
const maxBuffer = 20 * 1024 * 1024;
/**
* Execute a command
* @param {string} cmd
* @param {string[]} args
*/
export function exec(
cmd: string,
args: string[] = [],
opts: SpawnSyncOptions = {},
): SpawnSyncReturns<string> {
// args from shelljs
return spawnSync(cmd, args, { ...opts, maxBuffer, encoding: 'utf8' });
}