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
7 changes: 1 addition & 6 deletions script/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

'use strict';

const fs = require('fs');
const path = require('path');
const spawnSync = require('./lib/spawn-sync');

Expand Down Expand Up @@ -113,8 +112,6 @@ function getApmBinPath() {
}

function getNpmBinPath(external = false) {
if (process.env.NPM_BIN_PATH) return process.env.NPM_BIN_PATH;

const npmBinName = process.platform === 'win32' ? 'npm.cmd' : 'npm';
const localNpmBinPath = path.resolve(
repositoryRootPath,
Expand All @@ -123,7 +120,5 @@ function getNpmBinPath(external = false) {
'.bin',
npmBinName
);
return !external && fs.existsSync(localNpmBinPath)
? localNpmBinPath
: npmBinName;
return localNpmBinPath;
}
3 changes: 2 additions & 1 deletion script/lib/install-script-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ process.env.ELECTRON_CUSTOM_VERSION = CONFIG.appMetadata.electronVersion;

module.exports = function(ci) {
console.log('Installing script dependencies');
const npmBinName = process.platform === 'win32' ? 'npm.cmd' : 'npm';
childProcess.execFileSync(
CONFIG.getNpmBinPath(ci),
npmBinName,
['--loglevel=error', ci ? 'ci' : 'install'],
{ env: process.env, cwd: CONFIG.scriptRootPath }
);
Expand Down
21 changes: 0 additions & 21 deletions script/lib/verify-machine-requirements.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
const childProcess = require('child_process');
const path = require('path');

const CONFIG = require('../config');

module.exports = function(ci) {
verifyNode();
verifyNpm(ci);
verifyPython();
};

Expand All @@ -24,24 +21,6 @@ function verifyNode() {
}
}

function verifyNpm(ci) {
const stdout = childProcess.execFileSync(
CONFIG.getNpmBinPath(ci),
['--version'],
{ env: process.env }
);
const fullVersion = stdout.toString().trim();
const majorVersion = fullVersion.split('.')[0];
const oldestMajorVersionSupported = ci ? 6 : 3;
if (majorVersion >= oldestMajorVersionSupported) {
console.log(`Npm:\tv${fullVersion}`);
} else {
throw new Error(
`npm v${oldestMajorVersionSupported}+ is required to build Atom. npm v${fullVersion} was detected.`
);
}
}

function verifyPython() {
// This function essentially re-implements node-gyp's "find-python.js" library,
// but in a synchronous, bootstrap-script-friendly way.
Expand Down