Skip to content

Commit

Permalink
Fix: Assigning arch before generating the binary path
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayplow committed Mar 22, 2019
1 parent 8eb67a7 commit 1b7afbe
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions scripts/build.js
Expand Up @@ -88,27 +88,27 @@ var argv = Object.assign(Constants.DefaultOptions, yargs
alias: 'd'
}).argv);

var BinaryPath = sass.getBinaryPath(argv);
if (!argv.force && fs.existsSync(BinaryPath)) {
console.log('Binary found at', BinaryPath);
process.exit(0);
}

var gypOptions = {
arch: argv.arch,
jobs: argv.jobs,
target: argv.target,
debug: argv.debug
};
if (ModuleDetails[0] === Constants.Runtimes.ELECTRON) {
gypOptions['dist-url'] = 'https://atom.io/download/electron';
argv.arch = gypOptions.arch = process.platform === 'win32' ? 'ia32' : process.arch;
}
var BinaryPath = sass.getBinaryPath(argv);
if (!argv.force && fs.existsSync(BinaryPath)) {
console.log('Binary found at', BinaryPath);
process.exit(0);
}

var ModuleDetails = Constants.ModuleVersions[argv.modulesVersion];
if (!ModuleDetails) {
console.error('Unknown Node Modules Version: ' + argv.modulesVersion);
process.exit(1);
}
if (ModuleDetails[0] === Constants.Runtimes.ELECTRON) {
gypOptions['dist-url'] = 'https://atom.io/download/electron';
argv.arch = gypOptions.arch = process.platform === 'win32' ? 'ia32' : process.arch;
}

build(gypOptions, function (errorCode) {
if (errorCode) {
Expand Down

0 comments on commit 1b7afbe

Please sign in to comment.