diff --git a/src/utils.ts b/src/utils.ts index e31b3a0..a8ed33d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -13,7 +13,7 @@ export interface ExecResult { error?: cp.ExecFileException; } -export async function exec(command: string, args: string[], options: cp.ExecOptions = {}) { +export async function exec(command: string, args: string[], options: cp.ExecFileOptions = { shell: true }) { return new Promise((resolve, reject) => { cp.execFile(command, args, options, (error, stdout, stderr) => { if (error) { @@ -25,7 +25,12 @@ export async function exec(command: string, args: string[], options: cp.ExecOpti }); } -export async function execFeed(command: string, args: string[], options: cp.ExecOptions = {}, stdin: string) { +export async function execFeed( + command: string, + args: string[], + options: cp.ExecFileOptions = { shell: true }, + stdin: string, +) { return new Promise((resolve) => { const p = cp.execFile(command, args, options, (error, stdout, stderr) => { resolve({ stdout, stderr, error: error ? error : undefined });