Skip to content

Commit

Permalink
Fix NODE_PATH for legacy projects (#235)
Browse files Browse the repository at this point in the history
* Seems this doesn't matter anymore
#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 & occasionally replaced logger path

* onliner for makeInjectPath

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

* Finally got rid of broken parts.

* investigation checks issues

* investigation checks issues 2

* reverting changes for the test
  • Loading branch information
wentout authored and goto-bus-stop committed Apr 25, 2019
1 parent 55f879e commit ce6dd65
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Expand Up @@ -57,9 +57,15 @@ class ClinicDoctor 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 = {
// use NODE_PATH to work around issues with spaces in inject path
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 ce6dd65

Please sign in to comment.