From 7e03c8f345ca2d672a58e09d882fc5ef8edd8285 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Fri, 4 Jun 2010 12:34:41 -0400 Subject: [PATCH] fix error messages in cli --- lib/less/index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/less/index.js b/lib/less/index.js index 22483c80..4df5f307 100644 --- a/lib/less/index.js +++ b/lib/less/index.js @@ -1,4 +1,5 @@ var path = require('path'), + sys = require('sys'), fs = require('fs'); require.paths.unshift(path.join(__dirname, '..')); @@ -81,25 +82,25 @@ less.Parser.importer = function (file, paths, callback) { if (pathname) { fs.stat(pathname, function (e, stats) { - if (e) process.stdio.writeError(e); + if (e) sys.puts(e); fs.open(pathname, process.O_RDONLY, stats.mode, function (e, fd) { - if (e) process.stdio.writeError(e); + if (e) sys.puts(e); fs.read(fd, stats.size, 0, "utf8", function (e, data) { - if (e) process.stdio.writeError(e); + if (e) sys.puts(e); new(less.Parser)({ paths: [path.dirname(pathname)] }).parse(data, function (e, root) { - if (e) process.stdio.writeError(e); + if (e) sys.puts(e); callback(root); }); }); }); }); } else { - process.stdio.writeError("file '" + file + "' wasn't found.\n"); + sys.puts("file '" + file + "' wasn't found.\n"); process.exit(1); } }