Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/package-manager/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const createOptions = require('../create-options');
const spawn = require('../spawn');
const timeout = require('../timeout');

const envSeparator = process.platform === 'win32' ? ';' : ':';

function install(packageManager, context, next) {
const options = createOptions(
path.join(context.path, context.module.name),
Expand Down Expand Up @@ -35,7 +37,7 @@ function install(packageManager, context, next) {
packageManager === 'npm' ? context.npmPath : context.yarnPath;

const binDirectory = path.dirname(packageManagerBin);
options.env.PATH = `${binDirectory}:${process.env.PATH}`;
options.env.PATH = `${binDirectory}${envSeparator}${process.env.PATH}`;

const proc = spawn(packageManagerBin, args, options);
const finish = timeout(context, proc, next, 'Install');
Expand Down
6 changes: 4 additions & 2 deletions lib/package-manager/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const timeout = require('../timeout');

let nodeBinName = 'node'; // Mocked in tests

const envSeparator = process.platform === 'win32' ? ';' : ':';

function authorName(author) {
if (typeof author === 'string') return author;
let parts = [];
Expand Down Expand Up @@ -50,7 +52,7 @@ function test(packageManager, context, next) {
const options = createOptions(wd, context);
let nodeBin = 'node';
if (context.options.testPath) {
options.env.PATH = `${context.options.testPath}:${process.env.PATH}`;
options.env.PATH = `${context.options.testPath}${envSeparator}${process.env.PATH}`;
nodeBin = which(nodeBinName, {
path: options.env.PATH || process.env.PATH
});
Expand All @@ -60,7 +62,7 @@ function test(packageManager, context, next) {
packageManager === 'npm' ? context.npmPath : context.yarnPath;

const binDirectory = path.dirname(packageManagerBin);
options.env.PATH = `${binDirectory}:${process.env.PATH}`;
options.env.PATH = `${binDirectory}${envSeparator}${process.env.PATH}`;

/* Run `npm/yarn test`, or `/path/to/customTest.js` if the customTest option
was passed */
Expand Down