mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
merge compression argument support
This commit is contained in:
@@ -28,7 +28,8 @@ function writeFile(filename, content) {
|
||||
// Command line integration via Rhino
|
||||
(function (args) {
|
||||
name = args[0];
|
||||
var output = args[1];
|
||||
var output = args[1],
|
||||
compress = args[2];
|
||||
|
||||
if (!name) {
|
||||
print('No files present in the fileset; Check your pattern match in build.xml');
|
||||
@@ -42,6 +43,7 @@ function writeFile(filename, content) {
|
||||
print('lesscss: couldn\'t open file ' + name);
|
||||
quit(1);
|
||||
}
|
||||
|
||||
var result;
|
||||
try {
|
||||
var parser = new less.Parser();
|
||||
@@ -50,7 +52,7 @@ function writeFile(filename, content) {
|
||||
error(e, name);
|
||||
quit(1);
|
||||
} else {
|
||||
result = root.toCSS();
|
||||
result = root.toCSS({compress: compress || false});
|
||||
if (output) {
|
||||
writeFile(output, result);
|
||||
print("Written to " + output);
|
||||
|
||||
Reference in New Issue
Block a user