-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
55 lines (44 loc) · 1.07 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
var gulp = require('gulp'),
rimraf = require('rimraf'),
git = require('gulp-git'),
del = require('del');
/**
* Task: Clone
*/
gulp.task('git:clone', function(cb){
git.clone('https://github.com/gengojs/docs/', function (error) {
cb();
});
});
/**
* Task: Move
*/
gulp.task('move:docs:html',['git:clone'], function(){
return gulp.src('docs/dist/html/*.ejs')
.pipe(gulp.dest('views/partials/'));
});
gulp.task('move:docs:json',['git:clone'], function(){
return gulp.src('docs/dist/json/*.json')
.pipe(gulp.dest('locales/'));
});
/**
* Task: Clean
*/
gulp.task('clean:docs', function(cb){
rimraf('docs/',cb);
});
gulp.task('clean:docs:clone',['git:clone'], function(cb){
rimraf('docs/',cb);
});
gulp.task('clean:locales', function(cb){
rimraf('locales/',cb);
});
gulp.task('clean:templates', function(){
var views = 'views/partials/';
return del([
views + 'api.ejs',
views + 'intro.ejs'
]);
});
gulp.task('default', ['git:clone', 'move:docs:html', 'move:docs:json', 'clean:docs:clone']);
gulp.task('clean', ['clean:docs', 'clean:locales', 'clean:docs']);