-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
50 lines (50 loc) · 1.63 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
var gulp, tap, gulpLivescript, gulpRename, gulpYaml, replace, gutil, fs, cp, z, wait, def;
gulp = require('gulp');
tap = require('gulp-tap');
gulpLivescript = require('gulp-livescript');
gulpRename = require('gulp-rename');
gulpYaml = require('gulp-yaml');
replace = require('gulp-replace');
gutil = require('gulp-util');
fs = require('fs');
cp = require('child_process');
z = console.log;
wait = function(t, f){
return setTimeout(f, t);
};
def = function(done){
var ls;
gulp.src("./src/package.yaml").pipe(gulpYaml({
schema: 'DEFAULT_FULL_SCHEMA',
space: 2
})).on('error', function(it){
throw it;
}).pipe(gulp.dest("."));
gulp.src("./src/gulpfile.ls").pipe(gulpLivescript({
bare: true
})).on('error', gutil.log).on('error', function(it){
throw it;
}).pipe(gulp.dest("."));
ls = gulp.src("./src/*/*.ls").pipe(gulpLivescript({
bare: true
})).on('error', gutil.log).on('error', function(it){
throw it;
}).pipe(gulp.dest("./dist"));
ls.on('end', function(){
var rawJson, version_number, T;
rawJson = JSON.parse(fs.readFileSync('./package.json').toString());
version_number = rawJson.version;
return T = gulp.src("./dist/internal/main.js").pipe(replace('__VERSION__', version_number)).pipe(gulp.dest("./dist/internal/")).on('done', function(){});
});
return gulp.src("./test/*/*.ls").pipe(gulpLivescript({
bare: true
})).on('error', gutil.log).on('error', function(it){
throw it;
}).pipe(gulp.dest("./test"));
};
gulp.task('default', def);
gulp.task('watch', function(){
return gulp.watch(["./src", "./test/*/*.ls"], gulp.series('default', function(done){
return done();
}));
});