mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
when in lint mode, report errors from creating css. Fixes #1786
This commit is contained in:
23
bin/lessc
23
bin/lessc
@@ -352,8 +352,9 @@ var parseLessFile = function (e, data) {
|
||||
sys.print(file + " ")
|
||||
}
|
||||
sys.print("\n");
|
||||
} else if(!options.lint) {
|
||||
} else {
|
||||
try {
|
||||
if (options.lint) { writeSourceMap = function() {} }
|
||||
var css = tree.toCSS({
|
||||
silent: options.silent,
|
||||
verbose: options.verbose,
|
||||
@@ -374,15 +375,17 @@ var parseLessFile = function (e, data) {
|
||||
strictUnits: options.strictUnits,
|
||||
urlArgs: options.urlArgs
|
||||
});
|
||||
if (output) {
|
||||
ensureDirectory(output);
|
||||
fs.writeFileSync(output, css, 'utf8');
|
||||
if (options.verbose) {
|
||||
console.log('lessc: wrote ' + output);
|
||||
}
|
||||
} else {
|
||||
sys.print(css);
|
||||
}
|
||||
if(!options.lint) {
|
||||
if (output) {
|
||||
ensureDirectory(output);
|
||||
fs.writeFileSync(output, css, 'utf8');
|
||||
if (options.verbose) {
|
||||
console.log('lessc: wrote ' + output);
|
||||
}
|
||||
} else {
|
||||
sys.print(css);
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
less.writeError(e, options);
|
||||
currentErrorcode = 2;
|
||||
|
||||
Reference in New Issue
Block a user