Commit 6591ef05 by Adeel

Option: Omit source mapping url from output file.

Addresses #380.
parent 28c9018d
......@@ -54,6 +54,7 @@ void ExtractOptions(Local<Value> optionsValue, void* cptr, sass_context_wrapper*
ctx->options.image_path = CreateString(options->Get(NanNew("imagePath")));
ctx->options.output_style = options->Get(NanNew("style"))->Int32Value();
ctx->options.source_comments = source_comments = options->Get(NanNew("comments"))->Int32Value();
ctx->omit_source_map_url = options->Get(NanNew("omitSourceMapUrl"))->BooleanValue();
ctx->options.include_paths = CreateString(options->Get(NanNew("paths")));
if (source_comments == SASS_SOURCE_COMMENTS_MAP) {
ctx->source_map_file = CreateString(options->Get(NanNew("sourceMap")));
......@@ -66,6 +67,7 @@ void ExtractOptions(Local<Value> optionsValue, void* cptr, sass_context_wrapper*
ctx->options.image_path = CreateString(options->Get(NanNew("imagePath")));
ctx->options.output_style = options->Get(NanNew("style"))->Int32Value();
ctx->options.source_comments = source_comments = options->Get(NanNew("comments"))->Int32Value();
ctx->omit_source_map_url = options->Get(NanNew("omitSourceMapUrl"))->BooleanValue();
ctx->options.include_paths = CreateString(options->Get(NanNew("paths")));
ctx->options.precision = options->Get(NanNew("precision"))->Int32Value();
}
......
......@@ -42,6 +42,11 @@ var optimist = require('optimist')
describe: 'Print the resulting CSS to stdout',
type: 'boolean'
})
.options('omit-source-map-url', {
describe: 'Omit source map URL comment from output',
type: 'boolean',
alias: 'x'
})
.options('help', {
describe: 'Print usage info',
type: 'string',
......@@ -87,7 +92,8 @@ exports = module.exports = function(args) {
});
var options = {
stdout: argv.stdout
stdout: argv.stdout,
omitSourceMapUrl: argv['omit-source-map-url']
};
var inFile = options.inFile = argv._[0];
......
......@@ -13,6 +13,7 @@ function render(options, emitter) {
sourceMap: options.sourceMap,
precision: options.precision,
outFile: options.outFile,
omitSourceMapUrl: options.omitSourceMapUrl,
success: function(css, sourceMap) {
var todo = 1;
......
......@@ -69,6 +69,7 @@ var prepareOptions = function (options) {
imagePath: options.image_path || options.imagePath || '',
style: SASS_OUTPUT_STYLE[options.output_style || options.outputStyle] || 0,
comments: SASS_SOURCE_COMMENTS[sourceComments] || 0,
omitSourceMapUrl: options.omitSourceMapUrl,
stats: stats,
sourceMap: sourceMap,
precision: parseInt(options.precision) || 5,
......
......@@ -34,7 +34,7 @@ var sampleCssMapOutputPath = path.join(__dirname, '../sample.css.map');
describe('cli', function() {
it('should print help when run with no arguments', function(done) {
exec('node ' + cliPath, function(err, stdout, stderr) {
done(assert(stderr.indexOf('Compile .scss files with node-sass') === 0));
done(assert(stderr.trim().indexOf('Compile .scss files with node-sass') === 0));
});
});
......
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