Skip to content

Commit

Permalink
update 2020-04-22
Browse files Browse the repository at this point in the history
  • Loading branch information
lavrton committed Apr 22, 2020
1 parent b850262 commit 045466a
Show file tree
Hide file tree
Showing 3 changed files with 2,530 additions and 2,949 deletions.
40 changes: 19 additions & 21 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,41 @@ var gulp = require('gulp'),
shell = require('gulp-shell'),
jsdoc = require('gulp-jsdoc3');

// steps
// 2. generate new /public with hexo
// 3. replace /public/downloads with /source/downloads
// 4. generate api docs to /public

// 1 clean /public folder
gulp.task('clean-public', function() {
return gulp.src('public', { read: false }).pipe(clean());
gulp.task('clean-public', function () {
return gulp.src('public', { read: false, allowEmpty: true }).pipe(clean());
});

// 2 generate new /public with hexo
gulp.task(
'generate-hexo',
['clean-public'],
shell.task(['node ./node_modules/hexo/bin/hexo generate'], { cwd: './' })
gulp.series(
'clean-public',
shell.task(['node ./node_modules/hexo/bin/hexo generate'], { cwd: './' })
)
);

// 3 replace /public/downloads with /source/downloads
gulp.task('clean-public-downloads', ['generate-hexo'], function() {
gulp.task('clean-public-downloads', function () {
return gulp.src('public/downloads', { read: false }).pipe(clean());
});

gulp.task('copy-source-download', ['clean-public-downloads'], function() {
return gulp.src('source/downloads/**').pipe(gulp.dest('public/downloads'));
});
gulp.task(
'copy-source-download',
gulp.series('clean-public-downloads', function () {
return gulp.src('source/downloads/**').pipe(gulp.dest('public/downloads'));
})
);

// 4 generate api docs to /public
gulp.task('docs', ['clean-public'], function() {
gulp.task('docs', function () {
var config = require('./jsdoc.json');
return gulp.src(['./konva.js', '../konva/README.md']).pipe(jsdoc(config));
});

gulp.task('generate', [
'clean-public',
'generate-hexo',
'copy-source-download',
'docs'
]);
gulp.task(
'generate',
gulp.series('clean-public', 'generate-hexo', 'copy-source-download', 'docs')
);

gulp.task('default', ['generate']);
gulp.task('default', gulp.series('generate'));
Loading

0 comments on commit 045466a

Please sign in to comment.