Handle new ProcessGlobalArgsInternal function in node >19 (#1086)

* Handle new ProcessGlobalArgsInternal function in node >19

* Use 18.19.99 specifically

* Update src/patches/disable-node-cli.ts

Co-authored-by: Caleb Boyd <caleb.boyd@gmail.com>

---------

Co-authored-by: Caleb Boyd <caleb.boyd@gmail.com>
This commit is contained in:
Jake Pruitt
2024-04-29 14:27:29 +02:00
committed by calebboyd
parent d13388ab4c
commit 4bd27c06ce
+8 -1
View File
@@ -6,7 +6,14 @@ export default async function disableNodeCli(compiler: NexeCompiler, next: () =>
return next()
}
if (semverGt(compiler.target.version, '11.6.0')) {
if (semverGt(compiler.target.version, '18.99')) {
await compiler.replaceInFileAsync(
'src/node.cc',
/(?<!static ExitCode )ProcessGlobalArgsInternal\(argv[^;]*;/gm,
'ExitCode::kNoFailure;/*$&*/'
)
} else if (semverGt(compiler.target.version, '11.6.0')) {
await compiler.replaceInFileAsync(
'src/node.cc',
/(?<!int )ProcessGlobalArgs\(argv[^;]*;/gm,