Skip to content

Instantly share code, notes, and snippets.

@peponi
Created January 13, 2016 13:46
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 peponi/3d7a6e778611e08cf353 to your computer and use it in GitHub Desktop.
Save peponi/3d7a6e778611e08cf353 to your computer and use it in GitHub Desktop.
a simple gulp task to set & overwrite git tags on remote
// set a git tag & overwrite if already set
gulp.task('push-tag', function(cb) {
if(process.argv[3] !== '--tag' ) {
console.error('ERROR: no "--tag" parameter found');
} else if (process.argv[4] == undefined ) {
console.error('ERROR: no tag name found in parameter');
} else {
exec( 'git tag -d ' + process.argv[4] +
';git push origin :refs/tags/' + process.argv[4] +
';git tag ' + process.argv[4] +
';git push --tags', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment