Skip to content

Commit

Permalink
Add a code comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 8, 2024
1 parent 742a917 commit 61560da
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions source/spawn.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const spawnSubprocess = async (file, commandArguments, options, context)
try {
// When running `node`, keep the current Node version and CLI flags.
// Not applied with file paths to `.../node` since those indicate a clear intent to use a specific Node version.
// This also provides a way to opting out, e.g. using `process.execPath` instead of `node` to discard current CLI flags.
// Does not work with shebangs, but those don't work cross-platform anyway.
[file, commandArguments] = ['node', 'node.exe'].includes(file.toLowerCase())
? [process.execPath, [...process.execArgv.filter(flag => !flag.startsWith('--inspect')), ...commandArguments]]
Expand Down

0 comments on commit 61560da

Please sign in to comment.