balena-cli/gulpfile.coffee

41 lines
913 B
CoffeeScript
Raw Permalink Normal View History

2014-10-31 09:48:53 -04:00
path = require('path')
2014-10-31 09:37:29 -04:00
gulp = require('gulp')
2014-12-30 09:44:03 -04:00
coffee = require('gulp-coffee')
inlinesource = require('gulp-inline-source')
mocha = require('gulp-mocha')
2014-12-30 13:12:18 -04:00
shell = require('gulp-shell')
packageJSON = require('./package.json')
2014-10-31 09:37:29 -04:00
OPTIONS =
2014-10-31 09:50:50 -04:00
files:
coffee: [ 'lib/**/*.coffee', 'gulpfile.coffee' ]
app: 'lib/**/*.coffee'
tests: 'tests/**/*.spec.coffee'
pages: 'lib/auth/pages/*.ejs'
directories:
2014-12-30 09:44:03 -04:00
build: 'build/'
gulp.task 'pages', ->
gulp.src(OPTIONS.files.pages)
.pipe(inlinesource())
.pipe(gulp.dest('build/auth/pages'))
gulp.task 'coffee', ->
2014-12-30 09:44:03 -04:00
gulp.src(OPTIONS.files.app)
2017-03-22 12:46:06 +03:00
.pipe(coffee(bare: true, header: true))
2014-12-30 09:44:03 -04:00
.pipe(gulp.dest(OPTIONS.directories.build))
gulp.task 'test', ->
gulp.src(OPTIONS.files.tests, read: false)
.pipe(mocha({
reporter: 'spec'
}))
gulp.task 'build', [
'coffee',
'pages'
]
gulp.task 'watch', [ 'build' ], ->
gulp.watch([ OPTIONS.files.coffee ], [ 'build' ])