Skip to content

Commit

Permalink
Fix NODE_PATH for legacy projects (#319)
Browse files Browse the repository at this point in the history
* Seems this doesn't matter anymore
clinicjs/node-clinic-doctor#132

But ths still relates to current state
clinicjs/node-clinic#148

So there might be changes done to fix NODE_PATH back, for legacy projects.

* fix CI comma

* oneliner for makeInjectPath

* Additional Fix after code-review.
Thanks to @goto-bus-stop !
NODE_PATH works from both prospects.

* Finally got rid of broken parts.
  • Loading branch information
wentout authored and goto-bus-stop committed Apr 25, 2019
1 parent 005cfc1 commit 7ab6c83
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,14 @@ class ClinicBubbleprof extends events.EventEmitter {
stdio.push('pipe')
}

let NODE_PATH = path.join(__dirname, 'injects')
// use NODE_PATH to work around issues with spaces in inject path
if (process.env.NODE_PATH) {
NODE_PATH += `${process.platform === 'win32' ? ';' : ':'}${process.env.NODE_PATH}`
}

const customEnv = {
NODE_PATH: path.join(__dirname, 'injects'),
NODE_PATH,
NODE_OPTIONS: logArgs.join(' ') + (
process.env.NODE_OPTIONS ? ' ' + process.env.NODE_OPTIONS : ''
)
Expand Down

0 comments on commit 7ab6c83

Please sign in to comment.