Skip to content

Instantly share code, notes, and snippets.

Created September 12, 2015 21:45
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 anonymous/48f88a2c6a6ef2dad72c to your computer and use it in GitHub Desktop.
Save anonymous/48f88a2c6a6ef2dad72c to your computer and use it in GitHub Desktop.
function bumpVersion(bumpType) {
return function () {
var version = null;
gulp.src('./package.json')
.pipe(bump({type: bumpType}))
.pipe(gulp.dest('./'))
.pipe(tap(function (file) {
version = JSON.parse(String(file.contents)).version;
process.stdout.write('version ' + version); // correct version here
}))
.pipe(git.commit("Bump package version: " + version)) // but null here
.pipe(git.tag("v" + version, 'Version message', function (err) { // and here
if (err) throw err;
}));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment