From 4af416daa96991c08ee5916cbffe427fe53bf425 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Mon, 29 Dec 2025 00:05:38 +0100 Subject: [PATCH] node compatibility fixes --- lib/util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/util.js b/lib/util.js index a3c147e..a5aa90c 100644 --- a/lib/util.js +++ b/lib/util.js @@ -510,7 +510,7 @@ function powerShell(cmd) { try { const osVersion = os.release().split('.').map(Number); const spanOptions = - osVersion[0] < 0 + osVersion[0] < 10 ? ['-NoProfile', '-NoLogo', '-InputFormat', 'Text', '-NoExit', '-ExecutionPolicy', 'Unrestricted', '-Command', '-'] : ['-NoProfile', '-NoLogo', '-InputFormat', 'Text', '-ExecutionPolicy', 'Unrestricted', '-Command', cmd]; const child = spawn(_powerShell, spanOptions, { @@ -543,7 +543,7 @@ function powerShell(cmd) { child.kill(); resolve(result); }); - if (osVersion[0] < 0) { + if (osVersion[0] < 10) { try { child.stdin.write(_psToUTF8 + cmd + os.EOL); child.stdin.write('exit' + os.EOL);