balena-cli/gulpfile.coffee
Juan Cruz Viotti 3304e4bc98 Fix global *.roff installation issue
NPM refuses to install man pages that end in *.roff.
2014-12-24 15:12:31 -04:00

47 lines
1.1 KiB
CoffeeScript

path = require('path')
gulp = require('gulp')
mocha = require('gulp-mocha')
markedMan = require('gulp-marked-man')
coffeelint = require('gulp-coffeelint')
mochaNotifierReporter = require('mocha-notifier-reporter')
OPTIONS =
config:
coffeelint: path.join(__dirname, 'coffeelint.json')
files:
coffee: [ 'lib/**/*.coffee', 'gulpfile.coffee' ]
app: [ 'lib/**/*.coffee', '!lib/**/*.spec.coffee' ]
tests: 'lib/**/*.spec.coffee'
json: 'lib/**/*.json'
man: 'man/**/*.md'
directories:
man: 'man/'
gulp.task 'man', ->
gulp.src(OPTIONS.files.man)
.pipe(markedMan())
.pipe(gulp.dest(OPTIONS.directories.man))
gulp.task 'test', ->
gulp.src(OPTIONS.files.tests, read: false)
.pipe(mocha({
reporter: mochaNotifierReporter.decorate('landing')
}))
gulp.task 'lint', ->
gulp.src(OPTIONS.files.coffee)
.pipe(coffeelint({
optFile: OPTIONS.config.coffeelint
}))
.pipe(coffeelint.reporter())
gulp.task 'build', [
'lint'
'test'
'man'
]
gulp.task 'watch', [ 'test', 'lint' ], ->
gulp.watch([ OPTIONS.files.coffee, OPTIONS.files.json ], [ 'test', 'lint' ])
gulp.watch([ OPTIONS.files.man ], [ 'man' ])