Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
notheotherben committed Aug 30, 2015
1 parent db7c92c commit f02e177
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
20 changes: 14 additions & 6 deletions build/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,40 @@ gulp.task('doc', function() {
});

gulp.task('doc-build', function() {
return runSequence('doc-compile', 'doc-submodule');
return runSequence('doc-checkout', 'doc-compile', ['doc-submodule', 'doc-attributes']);
});

gulp.task('doc-checkout', function(cb) {
return git.checkout('gh-pages', { cwd: 'doc', quiet: true }, cb);
});

gulp.task('doc-submodule', function(cb) {
fs.writeFile('doc/.git', 'gitdir: ../.git/modules/doc', cb);
});

gulp.task('doc-attributes', function(cb) {
fs.writeFile('doc/.gitattributes', '* text=auto', cb);
});

gulp.task('doc-publish', function(cb) {
git.exec({ args: 'diff-files', quiet: true, cwd: 'doc' }, function(err, stdout) {
git.exec({ args: 'diff-files --quiet', quiet: true, cwd: 'doc' }, function(err, stdout) {
if(err && err.code === 1) runSequence('doc-commit', 'doc-update-ref', 'doc-push', cb);
else cb();
});
});

gulp.task('doc-commit', function() {
return gulp.src('.', { cwd: 'doc' })
.pipe(git.commit('Updated documentation', { options: '--quiet', cwd: 'doc', quiet: true }));
return gulp.src('**', { cwd: 'doc' })
.pipe(git.commit('Updated documentation', { cwd: 'doc' }));
});

gulp.task('doc-update-ref', function() {
return gulp.src('.')
.pipe(git.commit('Updated documentation', { options: '--quiet', quiet: true }));
.pipe(git.commit('Updated documentation'));
});

gulp.task('doc-push', function(cb) {
git.push('origin', 'gh-pages', { cwd: 'doc' }, cb);
git.push('origin', 'gh-pages', cb);
});

gulp.task('doc-compile', function() {
Expand Down
2 changes: 1 addition & 1 deletion doc
Submodule doc updated 1 files
+0 −287 interfaces/cache.html

0 comments on commit f02e177

Please sign in to comment.