Skip to content

Commit

Permalink
Handle new ProcessGlobalArgsInternal function in node >19 (#1086)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
jakepruitt and calebboyd committed Apr 29, 2024
1 parent 5fb5696 commit a339917
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/patches/disable-node-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a339917

Please sign in to comment.