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

Commit

Permalink
Merge pull request #880 from xzyfer/feat/build/respect-libsass-ext-flag
Browse files Browse the repository at this point in the history
Respect the LIBSASS_EXT build flag when falling back to git
  • Loading branch information
xzyfer committed May 3, 2015
2 parents 8c4e0ed + ff3fe62 commit f449895
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ function initSubmodules(cb) {
* @api private
*/

function installGitDependencies(cb) {
function installGitDependencies(options, cb) {
var libsassPath = './src/libsass';

if (fs.access) { // node 0.12+, iojs 1.0.0+
if (process.env.LIBSASS_EXT || options.libsassExt) {
cb();
} else if (fs.access) { // node 0.12+, iojs 1.0.0+
fs.access(libsassPath, fs.R_OK, function(err) {
err && err.code === 'ENOENT' ? initSubmodules(cb) : cb();
});
Expand All @@ -120,7 +122,7 @@ function installGitDependencies(cb) {
*/

function build(options) {
installGitDependencies(function(err) {
installGitDependencies(options, function(err) {
if (err) {
console.error(err.message);
process.exit(1);
Expand Down Expand Up @@ -171,6 +173,8 @@ function parseArgs(args) {
options.arch = arg.substring(14);
} else if (arg === '-d' || arg === '--debug') {
options.debug = true;
} else if (arg.substring(0, 13) === '--libsass_ext' && arg.substring(14) !== 'no') {
options.libsassExt = true;
}

return true;
Expand Down

0 comments on commit f449895

Please sign in to comment.