Skip to content

Instantly share code, notes, and snippets.

/gulp.js

Created Sep 12, 2015
Embed
What would you like to do?
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