Files
renovate/tools/utils/exec.ts
T
Jamie Tanna 1778e0424a refactor(tools): migrate to execa (#41062)
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>
2026-02-16 18:07:05 +00:00

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