fix: preserve Windows cmd start URL quoting (#794) (thanks @roshanasingh4)
This commit is contained in:
@@ -48,6 +48,7 @@ export type CommandOptions = {
|
||||
cwd?: string;
|
||||
input?: string;
|
||||
env?: NodeJS.ProcessEnv;
|
||||
windowsVerbatimArguments?: boolean;
|
||||
};
|
||||
|
||||
export async function runCommandWithTimeout(
|
||||
@@ -59,6 +60,7 @@ export async function runCommandWithTimeout(
|
||||
? { timeoutMs: optionsOrTimeout }
|
||||
: optionsOrTimeout;
|
||||
const { timeoutMs, cwd, input, env } = options;
|
||||
const { windowsVerbatimArguments } = options;
|
||||
const hasInput = input !== undefined;
|
||||
|
||||
// Spawn with inherited stdin (TTY) so tools like `pi` stay interactive when needed.
|
||||
@@ -67,6 +69,7 @@ export async function runCommandWithTimeout(
|
||||
stdio: [hasInput ? "pipe" : "inherit", "pipe", "pipe"],
|
||||
cwd,
|
||||
env: env ? { ...process.env, ...env } : process.env,
|
||||
windowsVerbatimArguments,
|
||||
});
|
||||
let stdout = "";
|
||||
let stderr = "";
|
||||
|
||||
Reference in New Issue
Block a user