mirror of
https://github.com/renovatebot/renovate.git
synced 2024-12-22 05:28:35 +00:00
d90de484b1
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
22 lines
436 B
TypeScript
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' });
|
|
}
|