From f1f061e1e3d5176e2ba3a88cbc4c04d3d48a6156 Mon Sep 17 00:00:00 2001 From: Attila Sukosd Date: Fri, 28 Aug 2015 09:31:55 +0200 Subject: [PATCH] Added target arch support Previously electron-prebuilt would download the prebuilt binaries for the architecture native to the platform. However there are cases where being able to download for another architecture is favourable. This patch adds support for setting the architecture through npm's --arch= parameter. (Issue #53) --- npm/install.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/npm/install.js b/npm/install.js index 3261c6958ac1..fac56ae5fab9 100755 --- a/npm/install.js +++ b/npm/install.js @@ -23,8 +23,11 @@ var paths = { if (!paths[platform]) throw new Error('Unknown platform: ' + platform) -// downloads if not cached -download({version: version}, extractFile) +if (process.env.npm_config_arch) { + download({version: version, arch: process.env.npm_config_arch}, extractFile) +} else { + download({version: version}, extractFile) +} // unzips and makes path.txt point at the correct executable function extractFile (err, zipPath) {