Files
nexe/src/patches/disable-node-cli.ts
T
2017-07-16 21:40:23 -05:00

13 lines
368 B
TypeScript

import { NexeCompiler } from '../compiler'
export default async function disableNodeCli(compiler: NexeCompiler, next: () => Promise<void>) {
if (compiler.options.enableNodeCli) {
return next()
}
const nodeccMarker = "argv[index][0] == '-'"
await compiler.replaceInFileAsync('src/node.cc', nodeccMarker, nodeccMarker.replace('-', ']'))
return next()
}