Skip to content

Commit 312f54b

Browse files
author
Nicholas C. Zakas
committed
Fixed issue with extra whitespace being output in quiet mode for CLI
1 parent 334d0ef commit 312f54b

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/cli/common.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ function cli(api){
7171
result = CSSLint.verify(input, gatherRules(options)),
7272
formatter = CSSLint.getFormatter(options.format || "text"),
7373
messages = result.messages || [],
74+
output,
7475
exitCode = 0;
7576

7677
if (!input) {
@@ -79,8 +80,11 @@ function cli(api){
7980
} else {
8081
//var relativeFilePath = getRelativePath(api.getWorkingDirectory(), fullFilePath);
8182
options.fullPath = api.getFullPath(relativeFilePath);
82-
api.print(formatter.formatResults(result, relativeFilePath, options));
83-
83+
output = formatter.formatResults(result, relativeFilePath, options);
84+
if (output){
85+
api.print(output);
86+
}
87+
8488
if (messages.length > 0 && pluckByType(messages, "error").length > 0) {
8589
exitCode = 1;
8690
}

0 commit comments

Comments
 (0)