-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
61 lines (52 loc) · 1.62 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
const gulp = require('gulp');
const del = require('del');
const exec = require('child_process').exec;
const gulpLoadPlugins = require('gulp-load-plugins');
//const gulpGitbook = require('gulp-gitbook');
const $ = gulpLoadPlugins();
gulp.task('copy-pdf', function () {
return gulp.src('./book.pdf')
.pipe(gulp.dest('./_book'));
});
gulp.task('copy-moby', function () {
return gulp.src('./book.moby')
.pipe(gulp.dest('./_book'));
});
gulp.task('clean', function () {
return del(['_book/**', '_book/.*', '!_book'], {
force: true
});
});
// Publishes the site to GitHub Pages
gulp.task('gh-pages', () => {
console.log('Publishing to GH Pages');
return gulp.src('./_book/**/*')
.pipe($.ghPages({
origin: 'origin',
branch: 'gh-pages'
}));
});
gulp.task('build-web', function (callback) {
// In gulp 4, you can return a child process to signal task completion
exec('gitbook build', function (err, stdout, stderr) {
console.log("Building Book WebSite")
console.log(stdout);
console.log(stderr);
console.log("Finish Building Book WebSite");
callback();
});
});
gulp.task('build-pdf', function (callback) {
// In gulp 4, you can return a child process to signal task completion
exec('gitbook pdf', function (err, stdout, stderr) {
console.log("Building Book PDF")
console.log(stdout);
console.log(stderr);
console.log("Finish Building Book PDF");
callback();
});
});
gulp.task('build-web2', function (cb) {
// gulpGitbook('website',cb);
});
gulp.task('publish', gulp.series('copy-pdf', 'gh-pages'));