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)
This commit is contained in:
parent
b3af5a9475
commit
f1f061e1e3
1 changed files with 5 additions and 2 deletions
|
@ -23,8 +23,11 @@ var paths = {
|
||||||
|
|
||||||
if (!paths[platform]) throw new Error('Unknown platform: ' + platform)
|
if (!paths[platform]) throw new Error('Unknown platform: ' + platform)
|
||||||
|
|
||||||
// downloads if not cached
|
if (process.env.npm_config_arch) {
|
||||||
|
download({version: version, arch: process.env.npm_config_arch}, extractFile)
|
||||||
|
} else {
|
||||||
download({version: version}, extractFile)
|
download({version: version}, extractFile)
|
||||||
|
}
|
||||||
|
|
||||||
// unzips and makes path.txt point at the correct executable
|
// unzips and makes path.txt point at the correct executable
|
||||||
function extractFile (err, zipPath) {
|
function extractFile (err, zipPath) {
|
||||||
|
|
Loading…
Reference in a new issue