-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add
--use-spawn-wrap=true
option (#1169)
Completely bypass spawn-wrap unless overridden with this new option.
- Loading branch information
1 parent
408c1cb
commit df4de4d
Showing
11 changed files
with
128 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,2 @@ | ||
var sw = require('spawn-wrap') | ||
var NYC = require('../index.js') | ||
|
||
var config = {} | ||
if (process.env.NYC_CONFIG) config = JSON.parse(process.env.NYC_CONFIG) | ||
config.isChildProcess = true | ||
|
||
config._processInfo = { | ||
pid: process.pid, | ||
ppid: process.ppid, | ||
parent: process.env.NYC_PROCESS_ID || null | ||
} | ||
if (process.env.NYC_PROCESSINFO_EXTERNAL_ID) { | ||
config._processInfo.externalId = process.env.NYC_PROCESSINFO_EXTERNAL_ID | ||
delete process.env.NYC_PROCESSINFO_EXTERNAL_ID | ||
} | ||
|
||
if (process.env.NYC_CONFIG_OVERRIDE) { | ||
const override = JSON.parse(process.env.NYC_CONFIG_OVERRIDE) | ||
config = { | ||
...config, | ||
...override | ||
} | ||
process.env.NYC_CONFIG = JSON.stringify(config) | ||
} | ||
|
||
;(new NYC(config)).wrap() | ||
|
||
sw.runMain() | ||
require('../lib/wrap') | ||
require('spawn-wrap').runMain() |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const NYC = require('../index.js') | ||
|
||
let config = {} | ||
if (process.env.NYC_CONFIG) { | ||
config = JSON.parse(process.env.NYC_CONFIG) | ||
} | ||
config.isChildProcess = true | ||
|
||
config._processInfo = { | ||
pid: process.pid, | ||
ppid: process.ppid, | ||
parent: process.env.NYC_PROCESS_ID || null | ||
} | ||
|
||
if (process.env.NYC_PROCESSINFO_EXTERNAL_ID) { | ||
config._processInfo.externalId = process.env.NYC_PROCESSINFO_EXTERNAL_ID | ||
delete process.env.NYC_PROCESSINFO_EXTERNAL_ID | ||
} | ||
|
||
if (process.env.NYC_CONFIG_OVERRIDE) { | ||
const override = JSON.parse(process.env.NYC_CONFIG_OVERRIDE) | ||
config = { | ||
...config, | ||
...override | ||
} | ||
process.env.NYC_CONFIG = JSON.stringify(config) | ||
} | ||
|
||
;(new NYC(config)).wrap() |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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