mirror of
https://github.com/balena-io/balena-cli.git
synced 2024-12-23 15:32:22 +00:00
6daed83d88
Change-Type: patch
41 lines
912 B
CoffeeScript
41 lines
912 B
CoffeeScript
path = require('path')
|
|
gulp = require('gulp')
|
|
coffee = require('gulp-coffee')
|
|
inlinesource = require('gulp-inline-source')
|
|
mocha = require('gulp-mocha')
|
|
shell = require('gulp-shell')
|
|
packageJSON = require('./package.json')
|
|
|
|
OPTIONS =
|
|
files:
|
|
coffee: [ 'lib/**/*.coffee', 'gulpfile.coffee' ]
|
|
app: 'lib/**/*.coffee'
|
|
tests: 'tests/**/*.spec.coffee'
|
|
pages: 'lib/auth/pages/*.ejs'
|
|
directories:
|
|
build: 'build/'
|
|
|
|
gulp.task 'pages', ->
|
|
gulp.src(OPTIONS.files.pages)
|
|
.pipe(inlinesource())
|
|
.pipe(gulp.dest('build/auth/pages'))
|
|
|
|
gulp.task 'coffee', ->
|
|
gulp.src(OPTIONS.files.app)
|
|
.pipe(coffee(bare: true, header: true))
|
|
.pipe(gulp.dest(OPTIONS.directories.build))
|
|
|
|
gulp.task 'test', ->
|
|
gulp.src(OPTIONS.files.tests, read: false)
|
|
.pipe(mocha({
|
|
reporter: 'min'
|
|
}))
|
|
|
|
gulp.task 'build', [
|
|
'coffee',
|
|
'pages'
|
|
]
|
|
|
|
gulp.task 'watch', [ 'build' ], ->
|
|
gulp.watch([ OPTIONS.files.coffee ], [ 'build' ])
|