diff --git a/nodejs/patch.sh b/nodejs/patch.sh index f6e7b11..acd1b89 100755 --- a/nodejs/patch.sh +++ b/nodejs/patch.sh @@ -1,2 +1,2 @@ #!/bin/bash -patch -R src/node-${VERSION}/lib/child_process.js patches/child_process_executor.diff \ No newline at end of file +patch src/node-${VERSION}/lib/child_process.js patches/child_process_executor.diff \ No newline at end of file diff --git a/nodejs/patches/child_process_executor.diff b/nodejs/patches/child_process_executor.diff index e0ded8e..e4c898f 100644 --- a/nodejs/patches/child_process_executor.diff +++ b/nodejs/patches/child_process_executor.diff @@ -1,18 +1,28 @@ -586,591d585 -< } else if (typeof options.shell === 'string') { -< file = '/bin/executor'; -< args = [ options.shell, '-c', command]; -< } else if (process.platform === 'android') { -< file = '/system/bin/sh'; -< args = ['-c', command]; -593,594c587,593 -< file = '/bin/executor'; -< args = command.split(' '); +576,587c576,578 +< if (process.platform === 'win32') { +< if (typeof options.shell === 'string') +< file = options.shell; +< else +< file = process.env.comspec || 'cmd.exe'; +< // '/d /s /c' is used only for cmd.exe. +< if (RegExpPrototypeTest(/^(?:.*\\)?cmd(?:\.exe)?$/i, file)) { +< args = ['/d', '/s', '/c', `"${command}"`]; +< windowsVerbatimArguments = true; +< } else { +< args = ['-c', command]; +< } --- -> if (typeof options.shell === 'string') -> file = options.shell; -> else if (process.platform === 'android') -> file = '/system/bin/sh'; -> else -> file = '/bin/sh'; -> args = ['-c', command]; +> if (typeof options.shell === 'string') { +> file = '/bin/executor'; +> args = [ options.shell, ...command.split(' ') ] +589,595c580,581 +< if (typeof options.shell === 'string') +< file = options.shell; +< else if (process.platform === 'android') +< file = '/system/bin/sh'; +< else +< file = '/bin/sh'; +< args = ['-c', command]; +--- +> file = '/bin/executor';; +> args = command.split(' ');