Skip to content

Commit 187d611

Browse files
committedJan 8, 2020
test: add path to nodeJs when running test:bin
- this allows the test to be run in a debugger without the complete PATH
1 parent d337f40 commit 187d611

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎tasks/test-bin.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const childProcess = require('child_process');
22
const fs = require('fs');
33
const os = require('os');
4+
const path = require('path');
45

56
const chai = require('chai');
67
chai.use(require('chai-diff'));
@@ -37,7 +38,13 @@ function executeBinHandlebars(...args) {
3738
}
3839

3940
function execFilesSyncUtf8(command, args) {
40-
return childProcess.execFileSync(command, args, { encoding: 'utf-8' });
41+
const env = process.env;
42+
env.PATH = addPathToNodeJs(env.PATH);
43+
return childProcess.execFileSync(command, args, { encoding: 'utf-8', env });
44+
}
45+
46+
function addPathToNodeJs(pathEnvironment) {
47+
return path.dirname(process.argv0) + path.delimiter + pathEnvironment;
4148
}
4249

4350
function normalizeCrlf(string) {

0 commit comments

Comments
 (0)
Please sign in to comment.