Skip to content

Commit

Permalink
strip ansi under production
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed May 25, 2016
1 parent 2f5de4f commit 837ff8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions lib/Default.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
humanizeMs = require 'ms'
chalk = require 'chalk'
formatUtil = require './Format'
stripAnsi = require 'strip-ansi'
CONST = require './Constants'
repeat = require 'repeat-string'

Expand Down Expand Up @@ -91,7 +92,7 @@ module.exports =
this

colorizeMessage: (type, message) ->
return message if not @color or CONST.ENV is 'production'
return stripAnsi message if not @color or CONST.ENV is 'production'

lineColor = CONST.LINE_COLOR
typeColor = @types[type].color
Expand All @@ -107,7 +108,7 @@ module.exports =
).join(' ')

colorize: (colors, message) ->
return message if not @color or CONST.ENV is 'production'
return stripAnsi message if not @color or CONST.ENV is 'production'
colors = colors.split ' '
stylize = chalk
stylize = stylize[color] for color in colors
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
"coffee-script": "~1.10.0",
"lodash.defaults": "~4.0.1",
"ms": "~0.7.1",
"repeat-string": "~1.5.4"
"repeat-string": "~1.5.4",
"strip-ansi": "~3.0.1"
},
"devDependencies": {
"acho-skin-cli": "~1.0.0",
"acho-skin-cli": "latest",
"browserify": "latest",
"coffeeify": "latest",
"date-utils": "latest",
Expand Down

0 comments on commit 837ff8d

Please sign in to comment.