-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
executable file
·94 lines (67 loc) · 2.5 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Generated by CoffeeScript 1.10.0
(function() {
var coffee, del, developServer, exit, gulp, gutil, mocha, notify, runSequence;
gulp = require('gulp');
del = require('del');
runSequence = require('run-sequence');
developServer = require('gulp-develop-server');
notify = require('gulp-notify');
mocha = require('gulp-mocha');
coffee = require('gulp-coffee');
gutil = require('gulp-util');
exit = require('gulp-exit');
gulp.task('default', function(callback) {
return runSequence(['clean'], ['coffee'], ['copyFiles'], ['serve', 'watch', 'test'], ['mochaSequence'], callback);
});
gulp.task('travis', function(callback) {
return runSequence(['clean'], ['coffee'], ['copyFiles'], ['serve'], ['mochaSequenceWillExit'], callback);
});
gulp.task('build', function(callback) {
return runSequence(['clean'], ['coffee'], ['copyFiles'], callback);
});
gulp.task('coffee', function() {
return gulp.src(['./src/**/*.coffee', './**/*.coffee']).pipe(coffee({
bare: true
}).on('error', gutil.log)).pipe(gulp.dest('./dist/'));
});
gulp.task('clean', function(callback) {
return del(['./dist/'], callback);
});
gulp.task('copyFiles', function() {
return gulp.src(['./src/*/*.db', './src/**/*.jpg', './deploy']).pipe(gulp.dest('./dist/'));
});
gulp.task('serve', function() {
return developServer.listen({
path: './dist/index.js'
});
});
gulp.task('watch', function() {
return gulp.watch(['./src/**/*.js'], ['reload']);
});
gulp.task('test', function() {
return gulp.watch(['./test/**/*.coffee'], ['mochaSequence']);
});
gulp.task('cleanDb', function(callback) {
return del(['./dist/database/'], callback);
});
gulp.task('mocha', function() {
return gulp.src('./dist/test/**/*.js').pipe(mocha());
});
gulp.task('mochaWillExit', function() {
return gulp.src('./dist/test/**/*.js').pipe(mocha()).pipe(exit());
});
gulp.task('mochaSequence', function(callback) {
return runSequence(['cleanDb'], ['coffee'], ['mocha'], callback);
});
gulp.task('mochaSequenceWillExit', function(callback) {
return runSequence(['cleanDb'], ['coffee'], ['mochaWillExit'], callback);
});
gulp.task('reload', function(callback) {
return runSequence(['copyFiles'], ['reload-node'], ['mochaSequence'], callback);
});
gulp.task('reload-node', function() {
developServer.restart();
return gulp.src('./dist/index.js').pipe(notify('Server restarted...'));
});
}).call(this);
//# sourceMappingURL=gulpfile.js.map