-
-
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.
chore: Update node-preload and use process-on-spawn (#1243)
- Loading branch information
1 parent
5258e9f
commit d44ff19
Showing
5 changed files
with
244 additions
and
326 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
'use strict' | ||
|
||
const processOnSpawn = require('process-on-spawn') | ||
|
||
const envToCopy = {} | ||
|
||
processOnSpawn.addListener(({ env }) => { | ||
Object.assign(env, envToCopy) | ||
}) | ||
|
||
const copyAtLoad = [ | ||
'NYC_CONFIG', | ||
'NYC_CWD', | ||
'NYC_PROCESS_ID', | ||
'BABEL_DISABLE_CACHE', | ||
'NYC_PROCESS_ID' | ||
] | ||
|
||
for (const env of copyAtLoad) { | ||
if (env in process.env) { | ||
envToCopy[env] = process.env[env] | ||
} | ||
} | ||
|
||
module.exports = function updateVariable (envName) { | ||
envToCopy[envName] = process.env[envName] | ||
} |
Oops, something went wrong.