Skip to content

Commit

Permalink
fixes gulp task
Browse files Browse the repository at this point in the history
  • Loading branch information
minwe committed Jun 4, 2015
1 parent be39800 commit 439c95e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
12 changes: 10 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@ var docUtil = require('amazeui-doc-util');
var runSequence = require('run-sequence');

var config = {
pkg: require('./package.json'),

// release task
ghPages: {
src: 'dist/**/*'
},

// remote branch
git: {
branch: 'master'
},

browserSync: {
notify: false,
server: 'dist',
Expand Down Expand Up @@ -68,8 +76,8 @@ var config = {

require('./tasks')(gulp, config);

gulp.task('default', function(cb) {
gulp.task('build', function(cb) {
runSequence('clean', ['browserify', 'less', 'markdown'], cb);
});

gulp.task('dev', ['default', 'server']);
gulp.task('dev', ['build', 'server']);
15 changes: 8 additions & 7 deletions tasks/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ var ghPages = require('gulp-gh-pages');
// add tag then publish to npm and push to git
module.exports = function(gulp, config) {
gulp.task('publish:tag', function(done) {
var pkg = require('./package.json');
var pkg = config.pkg;
// TODO: require(module.parent + './package.json')
var v = 'v' + pkg.version;
var message = 'Release ' + v;

Expand All @@ -16,7 +17,7 @@ module.exports = function(gulp, config) {
throw err;
}

git.push('origin', config.release.branch || 'master', function(err) {
git.push('origin', (config.git && config.git.branch) || 'master', function(err) {
if (err) {
throw err;
}
Expand All @@ -33,13 +34,13 @@ module.exports = function(gulp, config) {

var releaseTasks = ['publish:tag', 'publish:npm'];

if (config.example) {
gulp.task('publish:examples', ['build:examples'], function() {
return gulp.src(config.example.dist + '/**/*')
.pipe(ghPages());
if (config.ghPages) {
gulp.task('publish:docs', ['build'], function() {
return gulp.src(config.ghPages.src)
.pipe(ghPages(config.ghPages.options || {}));
});

releaseTasks.push('publish:examples');
releaseTasks.push('publish:docs');
}

gulp.task('release', releaseTasks);
Expand Down

0 comments on commit 439c95e

Please sign in to comment.