Fix bin/lessc to use less.js and callback-style

This commit is contained in:
cloudhead 2010-03-19 18:04:56 -04:00
parent f973deec28
commit 9a276481f1

View File

@ -6,7 +6,7 @@ var path = require('path'),
require.paths.unshift(__dirname, path.join(__dirname, '..'));
var less = require('lib/less/adapters/server');
var less = require('lib/less');
var args = process.argv.slice(1);
args = args.filter(function (arg) {
@ -42,9 +42,9 @@ fs.stat(input, function (e, stats) {
}
fs.open(input, process.O_RDONLY, stats.mode, function (e, fd) {
fs.read(fd, stats.size, 0, "utf8", function (e, data) {
tree = less.parser.parse(data);
if (less.parser.error) {
process.stdio.writeError(less.parser.error.message);
less.parser.parse(data, function (err, tree) {
if (err) {
process.stdio.writeError(err);
} else {
css = tree.toCSS([], {frames: []});
if (output) {
@ -57,4 +57,5 @@ fs.stat(input, function (e, stats) {
});
});
});
});