From 848fa10dee7cdbca7d33517cff93389b40259ae5 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Tue, 27 Oct 2015 16:23:12 -0700 Subject: [PATCH] =?UTF-8?q?=E2=87=A7(npm):=20Move=20to=20NPM3=20to=20short?= =?UTF-8?q?en=20paths=20on=20Win32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/package.json | 2 +- script/bootstrap | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/build/package.json b/build/package.json index 13efa2e7d..15f516872 100644 --- a/build/package.json +++ b/build/package.json @@ -36,7 +36,7 @@ "meta-marked": "^0.3.3", "minidump": "~0.8", "moment": "^2.10", - "npm": "2.14.7", + "npm": "3.3.10", "rcedit": "~0.3.0", "request": "^2.64", "rimraf": "~2.2.2", diff --git a/script/bootstrap b/script/bootstrap index 23266c6f6..d8ca5a641 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -32,7 +32,6 @@ function printArgs(args) { } function makeSqlite3Command() { - var npmPath = '"' + path.resolve(__dirname, '..', 'build', 'node_modules', '.bin', 'npm') + '"'; var nodeGypPath = '"' + path.resolve(__dirname, '..', 'build', 'node_modules', 'npm', 'node_modules', '.bin', 'node-gyp') + '"'; var appPackageJSON = JSON.parse(fs.readFileSync(path.resolve(__dirname, '..', 'package.json'))); var targetVersion = appPackageJSON['electronVersion']; @@ -45,7 +44,12 @@ function makeSqlite3Command() { var targetArch = require('os').arch(); } - return npmPath+" install https://github.com/bengotow/node-sqlite3/archive/master.tar.gz --ignore-scripts && cd node_modules/sqlite3 && "+npmPath+" run prepublish && "+nodeGypPath+" configure rebuild --target="+targetVersion+" --arch="+targetArch+" --target_platform="+targetPlatform+" --dist-url=https://atom.io/download/atom-shell --module_name=node_sqlite3 --module_path=../lib/binding/node-v44-"+targetPlatform+"-"+targetArch + return makeNPMPath() + " install https://github.com/bengotow/node-sqlite3/archive/master.tar.gz --ignore-scripts && cd node_modules/sqlite3 && "+nodeGypPath+" configure rebuild --target="+targetVersion+" --arch="+targetArch+" --target_platform="+targetPlatform+" --dist-url=https://atom.io/download/atom-shell --module_name=node_sqlite3 --module_path=../lib/binding/node-v44-"+targetPlatform+"-"+targetArch +} + +function makeNPMPath() { + var npmPath = path.resolve(__dirname, '..', 'build', 'node_modules', '.bin', 'npm'); + return fs.existsSync(npmPath) ? '"'+npmPath+'"' : 'npm'; } function bootstrap() { @@ -58,17 +62,15 @@ function bootstrap() { var apmPath = '"' + path.resolve(__dirname, '..', 'apm', 'node_modules', 'atom-package-manager', 'bin', 'apm') + '"'; var apmFlags = process.env.JANKY_SHA1 || process.argv.indexOf('--no-color') !== -1 ? ' --no-color' : ''; - var npmPath = path.resolve(__dirname, '..', 'build', 'node_modules', '.bin', 'npm'); - npmPath = fs.existsSync(npmPath) ? '"'+npmPath+'"' : 'npm'; var npmFlags = ' --userconfig=' + '"' + path.resolve('.npmrc') + '" '; var gruntPath = '"' + path.resolve(__dirname, '..', 'build', 'node_modules', '.bin', 'grunt') + '"'; var packagesToDedupe = ['fs-plus', 'humanize-plus', 'roaster', 'season', 'grim']; - var buildInstallCommand = npmPath + npmFlags + 'install'; + var buildInstallCommand = makeNPMPath() + npmFlags + 'install'; var buildInstallOptions = {cwd: path.resolve(__dirname, '..', 'build')}; - var apmInstallCommand = npmPath + npmFlags + '--target=0.10.40 ' + 'install'; + var apmInstallCommand = makeNPMPath() + npmFlags + '--target=0.10.40 ' + 'install'; var apmInstallOptions = {cwd: apmInstallPath}; var rebuildSqlite3Command = makeSqlite3Command();