File tree Expand file tree Collapse file tree 3 files changed +3
-28
lines changed Expand file tree Collapse file tree 3 files changed +3
-28
lines changed Original file line number Diff line number Diff line change 3
3
4
4
'use strict' ;
5
5
6
- const fs = require ( 'fs' ) ;
7
6
const path = require ( 'path' ) ;
8
7
const spawnSync = require ( './lib/spawn-sync' ) ;
9
8
@@ -113,8 +112,6 @@ function getApmBinPath() {
113
112
}
114
113
115
114
function getNpmBinPath ( external = false ) {
116
- if ( process . env . NPM_BIN_PATH ) return process . env . NPM_BIN_PATH ;
117
-
118
115
const npmBinName = process . platform === 'win32' ? 'npm.cmd' : 'npm' ;
119
116
const localNpmBinPath = path . resolve (
120
117
repositoryRootPath ,
@@ -123,7 +120,5 @@ function getNpmBinPath(external = false) {
123
120
'.bin' ,
124
121
npmBinName
125
122
) ;
126
- return ! external && fs . existsSync ( localNpmBinPath )
127
- ? localNpmBinPath
128
- : npmBinName ;
123
+ return localNpmBinPath ;
129
124
}
Original file line number Diff line number Diff line change @@ -9,8 +9,9 @@ process.env.ELECTRON_CUSTOM_VERSION = CONFIG.appMetadata.electronVersion;
9
9
10
10
module . exports = function ( ci ) {
11
11
console . log ( 'Installing script dependencies' ) ;
12
+ const npmBinName = process . platform === 'win32' ? 'npm.cmd' : 'npm' ;
12
13
childProcess . execFileSync (
13
- CONFIG . getNpmBinPath ( ci ) ,
14
+ npmBinName ,
14
15
[ '--loglevel=error' , ci ? 'ci' : 'install' ] ,
15
16
{ env : process . env , cwd : CONFIG . scriptRootPath }
16
17
) ;
Original file line number Diff line number Diff line change 3
3
const childProcess = require ( 'child_process' ) ;
4
4
const path = require ( 'path' ) ;
5
5
6
- const CONFIG = require ( '../config' ) ;
7
-
8
6
module . exports = function ( ci ) {
9
7
verifyNode ( ) ;
10
- verifyNpm ( ci ) ;
11
8
verifyPython ( ) ;
12
9
} ;
13
10
@@ -24,24 +21,6 @@ function verifyNode() {
24
21
}
25
22
}
26
23
27
- function verifyNpm ( ci ) {
28
- const stdout = childProcess . execFileSync (
29
- CONFIG . getNpmBinPath ( ci ) ,
30
- [ '--version' ] ,
31
- { env : process . env }
32
- ) ;
33
- const fullVersion = stdout . toString ( ) . trim ( ) ;
34
- const majorVersion = fullVersion . split ( '.' ) [ 0 ] ;
35
- const oldestMajorVersionSupported = ci ? 6 : 3 ;
36
- if ( majorVersion >= oldestMajorVersionSupported ) {
37
- console . log ( `Npm:\tv${ fullVersion } ` ) ;
38
- } else {
39
- throw new Error (
40
- `npm v${ oldestMajorVersionSupported } + is required to build Atom. npm v${ fullVersion } was detected.`
41
- ) ;
42
- }
43
- }
44
-
45
24
function verifyPython ( ) {
46
25
// This function essentially re-implements node-gyp's "find-python.js" library,
47
26
// but in a synchronous, bootstrap-script-friendly way.
You can’t perform that action at this time.
0 commit comments