Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit c9d828d

Browse files
committed
Fix: Assigning arch before generating the binary path
1 parent 8eb67a7 commit c9d828d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

scripts/build.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,27 +88,27 @@ var argv = Object.assign(Constants.DefaultOptions, yargs
8888
alias: 'd'
8989
}).argv);
9090

91-
var BinaryPath = sass.getBinaryPath(argv);
92-
if (!argv.force && fs.existsSync(BinaryPath)) {
93-
console.log('Binary found at', BinaryPath);
94-
process.exit(0);
91+
var ModuleDetails = Constants.ModuleVersions[argv.modulesVersion];
92+
if (!ModuleDetails) {
93+
console.error('Unknown Node Modules Version: ' + argv.modulesVersion);
94+
process.exit(1);
9595
}
96-
9796
var gypOptions = {
9897
arch: argv.arch,
9998
jobs: argv.jobs,
10099
target: argv.target,
101100
debug: argv.debug
102101
};
103-
var ModuleDetails = Constants.ModuleVersions[argv.modulesVersion];
104-
if (!ModuleDetails) {
105-
console.error('Unknown Node Modules Version: ' + argv.modulesVersion);
106-
process.exit(1);
107-
}
108102
if (ModuleDetails[0] === Constants.Runtimes.ELECTRON) {
109103
gypOptions['dist-url'] = 'https://atom.io/download/electron';
110104
argv.arch = gypOptions.arch = process.platform === 'win32' ? 'ia32' : process.arch;
111105
}
106+
var BinaryPath = sass.getBinaryPath(argv);
107+
if (!argv.force && fs.existsSync(BinaryPath)) {
108+
console.log('Binary found at', BinaryPath);
109+
process.exit(0);
110+
}
111+
112112

113113
build(gypOptions, function (errorCode) {
114114
if (errorCode) {

0 commit comments

Comments
 (0)