UNPKG

648 Btext/coffeescriptView Raw
1map = require 'map-stream'
2{green, magenta} = require 'colors'
3path = require 'path'
4
5log = ->
6 sig = "[#{green('gulp')}]"
7 args = Array.prototype.slice.call arguments
8 args.unshift sig
9
10 console.log.apply console, args
11
12print = (options = {}) ->
13 options = format: options if typeof options is 'function'
14 {format, colors} = options
15 colors ?= yes
16 format ?= (filepath) -> filepath
17
18 map (file, cb) ->
19 filepath = path.relative process.cwd(), file.path
20 filepath = magenta(filepath) if colors isnt false
21 formatted = format filepath
22 print.log formatted if formatted
23 cb null, file
24
25print.log = log
26
27module.exports = print