Created
          June 24, 2015 13:02 
        
      - 
      
 - 
        
Save welcoMattic/8e829da80e5a8c719a6f to your computer and use it in GitHub Desktop.  
    gulp bump
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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); | |
| }); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
            
Useful to bump version in
package.jsonandgit tagyour project in one command: