From 1b5dfa0f3ea498fb8acec84710ea960ee2419852 Mon Sep 17 00:00:00 2001 From: AnimeDL Date: Mon, 29 Jan 2024 18:16:14 -0800 Subject: [PATCH] Fix command line length issue Fixes long standing issue on windows where if the command line length was over 8191 characters, this was achieved by switching node.exec to use powershell.exe instead of cmd.exe on Windows --- modules/sei-helper-fixes.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/sei-helper-fixes.ts b/modules/sei-helper-fixes.ts index 4a6d6eb..8545b84 100644 --- a/modules/sei-helper-fixes.ts +++ b/modules/sei-helper-fixes.ts @@ -10,7 +10,11 @@ const exec = (pname: string, fpath: string, pargs: string, spc = false): { pargs = pargs ? ' ' + pargs : ''; console.info(`\n> "${pname}"${pargs}${spc ? '\n' : ''}`); try { - childProcess.execSync((fpath + pargs), { stdio: 'inherit' }); + if (process.platform === 'win32') { + childProcess.execSync(('& ' + fpath + pargs), { stdio: 'inherit', 'shell': 'powershell.exe', 'windowsHide': true }); + } else { + childProcess.execSync((fpath + pargs), { stdio: 'inherit' }); + } return { isOk: true };