Skip to content

Commit ee56b4b

Browse files
author
steven nguyen
committed
separate getLocalNpmBinPath for install-apm.js
1 parent ece90b3 commit ee56b4b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

script/config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ module.exports = {
5454
homeDirPath,
5555
getApmBinPath,
5656
getNpmBinPath,
57+
getLocalNpmBinPath,
5758
snapshotAuxiliaryData: {}
5859
};
5960

@@ -114,3 +115,15 @@ function getApmBinPath() {
114115
function getNpmBinPath() {
115116
return process.platform === 'win32' ? 'npm.cmd' : 'npm';
116117
}
118+
119+
function getLocalNpmBinPath() {
120+
const npmBinName = process.platform === 'win32' ? 'npm.cmd' : 'npm';
121+
const localNpmBinPath = path.resolve(
122+
repositoryRootPath,
123+
'script',
124+
'node_modules',
125+
'.bin',
126+
npmBinName
127+
);
128+
return localNpmBinPath;
129+
}

script/lib/install-apm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = function(ci) {
1212
}
1313
console.log('Installing apm');
1414
childProcess.execFileSync(
15-
CONFIG.getNpmBinPath(),
15+
CONFIG.getLocalNpmBinPath(),
1616
['--global-style', '--loglevel=error', ci ? 'ci' : 'install'],
1717
{ env: process.env, cwd: CONFIG.apmRootPath }
1818
);

0 commit comments

Comments
 (0)