Commit 8b2b2c4f by Dean Mao

fix sass.js for build

parent 7eeba5e4
var binding; var binding;
var fs = require('fs'); var fs = require('fs');
var path = require('path');
var v8 = 'v8-' + /[0-9]+\.[0-9]+/.exec(process.versions.v8)[0];
var modPath = path.join(__dirname, 'bin', process.platform + '-' + process.arch + '-' + v8, 'binding');
try { try {
if (fs.realpathSync(__dirname + '/build')) { if (fs.realpathSync(__dirname + '/build')) {
// use the build version if it exists // use the build version if it exists
binding = require(__dirname + '/build/Release/binding'); binding = require(__dirname + '/build/Release/binding');
} }
} catch (e) { } catch (e) {
// default to a precompiled binary if no build exists try {
var platform_full = process.platform+'-'+process.arch; fs.realpathSync(modPath + '.node');
binding = require(__dirname + '/precompiled/'+platform_full+'/binding'); binding = require(modPath);
} } catch (ex) {
if (binding === null) { // No binary!
throw new Error('Cannot find appropriate binary library for node-sass'); throw new Error('`'+ modPath + '.node` is missing. Try reinstalling `node-sass`?');
}
} }
var SASS_OUTPUT_STYLE = { var SASS_OUTPUT_STYLE = {
......
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