Created
June 5, 2014 06:38
-
-
Save dreadjr/2d3d9ae052ace0db4989 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var gulp = require('gulp'); | |
| var gutil = require('gulp-util'); | |
| var shell = require('gulp-shell'); | |
| var git = require('gulp-git'); | |
| var docco = require('gulp-docco'); | |
| var cache = require('gulp-cached'); | |
| var remember = require('gulp-remember'); | |
| // Docs Task | |
| // ========= | |
| // The `docs` task builds docco files, switches to the gh-pages | |
| // branch, commits the docs, and switches back to the | |
| // development branch. | |
| // | |
| // Usage: `gulp docs` | |
| // | |
| gulp.task('checkout-master', shell.task(['git checkout master'])); | |
| gulp.task('docs-make', ['checkout-master'], function() { | |
| return gulp.src('./lib/**/*.js') | |
| .pipe(docco()) | |
| .pipe(cache('docs')) | |
| .pipe(gulp.dest('./docs/')) | |
| .on('error', gutil.log); | |
| }); | |
| gulp.task('docs-commit', ['docs-make'], shell.task([ | |
| 'git checkout gh-pages', | |
| 'git add ./docs', | |
| 'git commit -a -m \"update docs\"', | |
| 'git checkout master', | |
| 'git checkout -b development' | |
| ])); | |
| gulp.task('docs', ['docs-commit'], function() { | |
| git.push('origin', 'gh-pages'); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment