mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-25 23:11:31 +00:00
1778e0424a
For consistency, we should use `execa` for all of our command execution. Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
22 lines
451 B
TypeScript
22 lines
451 B
TypeScript
import type { ExecaSyncReturnValue, SyncOptions } from 'execa';
|
|
import { execaSync } from 'execa';
|
|
|
|
const maxBuffer = 20 * 1024 * 1024;
|
|
|
|
/**
|
|
* Execute a command synchronously using execa
|
|
* @param {string} cmd
|
|
* @param {string[]} args
|
|
*/
|
|
export function exec(
|
|
cmd: string,
|
|
args: string[] = [],
|
|
opts: SyncOptions = {},
|
|
): ExecaSyncReturnValue<string> {
|
|
return execaSync(cmd, args, {
|
|
...opts,
|
|
maxBuffer,
|
|
encoding: 'utf8',
|
|
});
|
|
}
|