mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-26 02:05:31 +00:00
test(plugins): exit the %~1 reader script with 0 on Windows
`set /p` without input exits with errorlevel 1, so execCommand reported the reader script as failed even though it printed its arguments.
This commit is contained in:
@@ -231,7 +231,8 @@ test.runIf(process.platform === "win32")(
|
||||
const directory = await mkdtemp(path.join(os.tmpdir(), "plugin script reader "));
|
||||
roots.push(directory);
|
||||
const script = path.join(directory, "read.cmd");
|
||||
await writeFile(script, '@echo off\r\n<nul set /p "=%~1|%~2|%~3|%~4|%~5"\r\n');
|
||||
// `set /p` without input exits 1, so the script exits 0 on its own.
|
||||
await writeFile(script, '@echo off\r\n<nul set /p "=%~1|%~2|%~3|%~4|%~5"\r\nexit /b 0\r\n');
|
||||
const { stdout } = await execCommand(script, [
|
||||
"plain",
|
||||
"with space",
|
||||
|
||||
Reference in New Issue
Block a user