diff --git a/lib/extensions.js b/lib/extensions.js index 7f55a45ce..eaa8ff937 100644 --- a/lib/extensions.js +++ b/lib/extensions.js @@ -167,7 +167,6 @@ function getBinaryUrl() { * callers wants to throw if file not exists before * returning. * - * @param {Boolean} throwIfNotExists * @api public */ @@ -189,6 +188,13 @@ function getBinaryPath() { return binaryPath; } +/** + * Does the supplied binary path exist + * + * @param {String} binaryPath + * @api public + */ + function hasBinary(binaryPath) { return fs.existsSync(binaryPath); } diff --git a/scripts/install.js b/scripts/install.js index 421a61686..ec82b9eca 100644 --- a/scripts/install.js +++ b/scripts/install.js @@ -81,7 +81,7 @@ function applyProxy(options, cb) { */ function checkAndDownloadBinary() { - if (sass.getBinaryPath()) { + if (sass.hasBinary(sass.getBinaryPath())) { return; } @@ -97,7 +97,7 @@ function checkAndDownloadBinary() { return; } - console.log('Binary downloaded and installed at', sass.binaryPath()); + console.log('Binary downloaded and installed at', sass.getBinaryPath()); }); }); }