Commit 0fa5e5eb by xzyfer

Fix a regression in binary verification

A regression introduced in 22c560c7 broke binary verification
causing the binary to always be built locally.

Fixes #1434
parent d76923b4
...@@ -167,7 +167,6 @@ function getBinaryUrl() { ...@@ -167,7 +167,6 @@ function getBinaryUrl() {
* callers wants to throw if file not exists before * callers wants to throw if file not exists before
* returning. * returning.
* *
* @param {Boolean} throwIfNotExists
* @api public * @api public
*/ */
...@@ -189,6 +188,13 @@ function getBinaryPath() { ...@@ -189,6 +188,13 @@ function getBinaryPath() {
return binaryPath; return binaryPath;
} }
/**
* Does the supplied binary path exist
*
* @param {String} binaryPath
* @api public
*/
function hasBinary(binaryPath) { function hasBinary(binaryPath) {
return fs.existsSync(binaryPath); return fs.existsSync(binaryPath);
} }
......
...@@ -81,7 +81,7 @@ function applyProxy(options, cb) { ...@@ -81,7 +81,7 @@ function applyProxy(options, cb) {
*/ */
function checkAndDownloadBinary() { function checkAndDownloadBinary() {
if (sass.getBinaryPath()) { if (sass.hasBinary(sass.getBinaryPath())) {
return; return;
} }
...@@ -97,7 +97,7 @@ function checkAndDownloadBinary() { ...@@ -97,7 +97,7 @@ function checkAndDownloadBinary() {
return; return;
} }
console.log('Binary downloaded and installed at', sass.binaryPath()); console.log('Binary downloaded and installed at', sass.getBinaryPath());
}); });
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment