Download, compile, save, etc

This commit is contained in:
Tom MacWright 2011-01-04 14:47:00 -05:00
parent 5d9d41a815
commit 5aa09d6d72
5 changed files with 29 additions and 17 deletions

View File

@ -72,23 +72,12 @@ fs.readFile(input, 'utf-8', function (e, data) {
paths: [path.dirname(input)],
optimization: options.optimization,
filename: input
}).render(data, function (err, tree) {
}).render(data, function (err, output) {
if (err) {
less.writeError(err, options);
process.exit(1);
} else {
try {
css = tree.toCSS({ compress: options.compress });
if (output) {
fd = fs.openSync(output, "w");
fs.writeSync(fd, css, 0, "utf8");
} else {
sys.print(css);
}
} catch (e) {
less.writeError(e, options);
process.exit(2);
}
sys.puts(output);
}
});
});

View File

@ -99,7 +99,7 @@ var External = function External(env) {
fs.renameSync(
filename,
destination);
return destination;
callback(null, [resource_url, destination]);
} else {
throw Exception('Non-extended files cannot be processed');
}
@ -154,7 +154,7 @@ var External = function External(env) {
}
});
}
}
};
};
module.exports = External;

View File

@ -92,7 +92,7 @@ module.exports = {
});
request.end();
console.log('Downloading\n\t%s', file_url.hostname);
console.log('Downloading from host:\n\t%s', file_url.hostname);
var f = fs.createWriteStream(filename);
request.on('response', function(response) {
response.on('data', function(chunk) {

View File

@ -1001,4 +1001,3 @@ if (typeof(window) !== 'undefined') {
loadStyleSheet({ href: path, title: path, type: env.mime }, callback, true);
};
}

View File

@ -4,6 +4,30 @@ tree.Filter = function (key, op, val) {
this.key = key;
this.op = op;
this.val = val;
this.zooms = {
'1': [200000000, 500000000],
'2': [100000000, 200000000],
'3': [50000000, 100000000],
'4': [25000000, 50000000],
'5': [12500000, 25000000],
'6': [6500000, 12500000],
'7': [3000000, 6500000],
'8': [1500000, 3000000],
'9': [750000, 1500000],
'10': [400000, 750000],
'11': [200000, 400000],
'12': [100000, 200000],
'13': [50000, 100000],
'14': [25000, 50000],
'15': [12500, 25000],
'16': [5000, 12500],
'17': [2500, 5000],
'18': [1000, 2500],
'19': [500, 1000],
'20': [250, 500],
'21': [100, 250],
'22': [50, 100],
};
};
/*
* tree.Attribute.prototype.match = function (other) {