Skip to content

Commit 03edb0d

Browse files
author
nilguncelik
committed
Fix gulp gh-pages task override gh-pages branch issue.
1 parent 59f2820 commit 03edb0d

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

gulpfile.js

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
var gulp = require('gulp');
22
var shell = require("gulp-shell");
3-
var ghPages = require('gulp-gh-pages');
43
var runSequence = require('run-sequence');
54

5+
var GH_TOKEN = process.env.GH_TOKEN || '';
6+
67
gulp.task('jsdoc', shell.task([
78
'rm -rf ./docs',
89
'jsdoc -c ./scripts/jsdoc-conf.json'
910
]));
1011

11-
gulp.task('gh-pages', ['jsdoc'], function() {
12-
var GH_TOKEN = process.env.GH_TOKEN || '';
13-
return gulp.src('./docs/**/*').
14-
pipe(ghPages({ remoteUrl: 'https://' + GH_TOKEN + '@github.com/tart/tartJS.git' }));
15-
});
12+
gulp.task('gh-pages', ['jsdoc'], shell.task([
13+
'mv docs docs_new',
14+
'git remote add upstream https://' + GH_TOKEN + '@github.com/tart/tartJS.git/',
15+
'git fetch upstream',
16+
'git checkout -b gh-pages upstream/gh-pages',
17+
'rm -rf docs',
18+
'mv docs_new docs',
19+
'git add docs',
20+
'git commit -m "Update documentation"',
21+
'git push upstream gh-pages',
22+
'git checkout master'
23+
]));
1624

1725
gulp.task('travis-master', ['gh-pages']);
1826

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"dependencies": {},
99
"devDependencies": {
1010
"gulp": "^3.9.0",
11-
"gulp-gh-pages": "^0.5.2",
1211
"gulp-shell": "^0.4.2",
1312
"jaguarjs-jsdoc": "git://github.com/davidshimjs/jaguarjs-jsdoc",
1413
"jsdoc": "^3.3.2",

0 commit comments

Comments
 (0)