Skip to content

Instantly share code, notes, and snippets.

@welcoMattic
Created June 24, 2015 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save welcoMattic/8e829da80e5a8c719a6f to your computer and use it in GitHub Desktop.
Save welcoMattic/8e829da80e5a8c719a6f to your computer and use it in GitHub Desktop.
gulp bump
var gulp = require('gulp');
var replace = require('gulp-replace');
var info = require('./package.json');
var args = require('yargs').argv;
var exec = require('child_process').exec;
// $ gulp bump -v x.x.x
gulp.task('bump', function () {
gulp.src([
'package.json'
])
.pipe(replace(info.version, args.v || args.version))
.pipe(gulp.dest(function(file) {
return file.base;
}));
var child = exec('git tag ' + args.v || args.version, {}, function() {});
child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stdout);
});
@welcoMattic
Copy link
Author

Useful to bump version in package.json and git tag your project in one command:

$ gulp bump -v x.x.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment