forked from i5ting/vsc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (29 loc) · 816 Bytes
/
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
var gulp = require('gulp');
var gp_deploy = require('gulp-gh-pages');
var open = require("gulp-open");
var rename = require("gulp-rename");
require('shelljs/global');
var options = {}
gulp.task('deploy', function () {
return gulp.src('./preview/**/*')
.pipe(gp_deploy(options));
});
gulp.task('rename',function () {
if (exec('cp ./preview/README.html ./preview/index.html').code !== 0) {
echo('Error: rename exec failed');
exit(1);
}
});
gulp.task('generate',function () {
// Run external tool synchronously
if (exec('sh ./generate.sh').code !== 0) {
echo('Error: generate.sh exec failed');
exit(1);
}
});
gulp.task('show',['generate'] ,function () {
console.log('show');
});
gulp.task('default',['generate', 'rename', 'deploy'] ,function () {
console.log('default');
});