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:
Mohamed Boudra
2026-11-25 17:37:33 +01:00
parent 372c1ba949
commit de5f139d33
+2 -1
View File
@@ -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",