Skip to content

Commit

Permalink
Check for messages length before logging. (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR authored and RyanZim committed Jan 4, 2019
1 parent afdc65f commit 8c0a465
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,13 +235,16 @@ function css(css, file) {
chalk`{green Finished {bold ${relativePath}} in {bold ${prettyTime}}}`
)

console.warn(
reporter(
Object.assign({}, result, {
messages: result.warnings()
})
const messages = result.warnings()
if (messages.length) {
console.warn(
reporter(
Object.assign({}, result, {
messages
})
)
)
)
}

return result
})
Expand Down

0 comments on commit 8c0a465

Please sign in to comment.