merge compression argument support

This commit is contained in:
Luke Page
2012-07-29 11:37:13 +01:00

View File

@@ -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);