Skip to content

Commit

Permalink
improved release tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed Apr 19, 2016
1 parent 9d396fe commit e13d2d2
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,29 @@ gulp.task('dev', function(callback) {
});

gulp.task('release', function(callback) {
sequence('build:dev', 'build:examples', 'test', 'bump', 'reload', 'build:edge', 'build:release', 'doc', 'changelog', callback);
shell('git status --porcelain', function(err, stdout) {
if (stdout && stdout.trim()) {
throw new gutil.PluginError({
plugin: 'release',
message: 'cannot build release as there are uncomitted changes'
});
} else {
sequence('build:dev', 'build:examples', 'test', 'bump', 'reload', 'build:edge', 'build:release', 'doc', 'changelog', callback);
}
});
});

gulp.task('release:push', function(callback) {
sequence('tag', 'release:push:git', 'release:push:github', 'release:push:npm', callback);
shell('git status --porcelain', function(err, stdout) {
if (stdout && stdout.trim()) {
throw new gutil.PluginError({
plugin: 'release',
message: 'cannot push release as it has not yet been committed'
});
} else {
sequence('tag', 'release:push:git', 'release:push:github', 'release:push:npm', callback);
}
});
});

gulp.task('release:push:github', function(callback) {
Expand Down Expand Up @@ -250,8 +268,8 @@ var build = function(options) {

var shell = function(command, callback) {
var args = process.argv.slice(3).join(' '),
proc = exec(command + ' ' + args, function(err) {
callback(err);
proc = exec(command + ' ' + args, function(err, stdout, stderr) {
callback(err, stdout, stderr, proc);
});

proc.stdout.on('data', function(data) {
Expand Down

0 comments on commit e13d2d2

Please sign in to comment.