-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
70 lines (56 loc) · 1.81 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
/********************************************************************
* Imports
*******************************************************************/
var pump = require('pump'),
gulp = require("gulp"),
gutil = require("gulp-util"),
clean = require('gulp-clean'),
uglify = require("gulp-uglify"),
nodemon = require('gulp-nodemon'),
shell = require('gulp-shell'),
runSequence = require('run-sequence').use(gulp),
rename = require("gulp-rename")
/********************************************************************
* Tasks
*******************************************************************/
gulp.task("clean")
gulp.task("build", [], function (cb) {
runSequence('clean', ['buildinfo', 'package.json', 'index.html', 'hack.html'], cb)
})
gulp.task("package.json", [], function (cb) {
gulp.src('package*.json')
.pipe(rename({
extname: ''
}))
.pipe(gulp.dest('./editions/material/tiddlers/files/'))
})
gulp.task("buildinfo", [], shell.task([
"hack/buildinfo"
], { verbose: true }))
gulp.task("index.html", ['buildinfo'], shell.task([
"node index.js editions/material --build"
]))
gulp.task("test", shell.task([
"node index.js editions/test --build 2>&1 | tee test.out; ! grep -q ^Failures: test.out"
]))
// ref: https://stackoverflow.com/questions/28048029/running-a-command-with-gulp-to-start-node-js-server
gulp.task('server', function() {
nodemon({
watch: ["plugins", "themes", "editions/material"]
}).on('restart', ['build'])
})
gulp.task('hack', function() {
nodemon({
watch: ["plugins", "themes", "editions/material"]
}).on('restart', ['build', 'test'])
})
gulp.task("hack.html", ['buildinfo'], shell.task([
"node index.js editions/hack-fs --build"
]))
gulp.task("commit", [], shell.task([
"git add -A",
"git commit -a -m wip"
]))
gulp.task("push", [], shell.task([
"git push"
]))