Skip to content

Commit 8c0a465

Browse files
XhmikosRRyanZim
authored andcommitted
Check for messages length before logging. (#257)
1 parent afdc65f commit 8c0a465

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

index.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,16 @@ function css(css, file) {
235235
chalk`{green Finished {bold ${relativePath}} in {bold ${prettyTime}}}`
236236
)
237237

238-
console.warn(
239-
reporter(
240-
Object.assign({}, result, {
241-
messages: result.warnings()
242-
})
238+
const messages = result.warnings()
239+
if (messages.length) {
240+
console.warn(
241+
reporter(
242+
Object.assign({}, result, {
243+
messages
244+
})
245+
)
243246
)
244-
)
247+
}
245248

246249
return result
247250
})

0 commit comments

Comments
 (0)