Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from ericclemmons/19-execArgv
Support "-r" flags via child_process.fork/spawn?
- Loading branch information
Showing
5 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
#!/usr/bin/env node | ||
|
||
require("../src/server") | ||
const child_process = require("child_process") | ||
const path = require("path") | ||
|
||
const serverPath = path.resolve(__dirname, "../src/server.js") | ||
const [, , ...args] = process.argv | ||
|
||
// Remove polydev custom flags | ||
const execArgv = args.filter(arg => !["--open"].includes(arg)) | ||
|
||
// Spawn server via node + flags | ||
child_process.fork(serverPath, args, { | ||
execArgv | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters