craigsimps / gulp-wp-toolkit

Re-usable Gulp Toolkit for WordPress Themes
MIT License
88 stars 10 forks source link

Bump task does not respect arguments #87

Closed timothyjensen closed 6 years ago

timothyjensen commented 6 years ago

Expected Behavior

Running the command gulp bump --minor should bump version 1.0.0 to 1.1.0.

Current Behavior

Running the command gulp bump --minor or gulp bump --major bumps version 1.0.0 to 1.0.1.

Your Environment

timothyjensen commented 6 years ago

The simplest fix is to run the command as gulp bump --type=minor instead of the simplified gulp bump --minor, although I prefer the latter because it's fewer characters.

One way to fix this bug is to change type to a variable and then assign it a value like so:

if ( args.hasOwnProperty('major') ) {
  type = 'major';
} else if ( args.hasOwnProperty('minor') ) {
  type = 'minor';
} else {
  type = 'patch';
}
blogjunkie commented 5 years ago

Hi @craigsimps I'm still getting this bug on gulp-wp-toolkit v 2.3.2

$ gulp bump --major
[10:56:10] Using gulpfile ~/Sites/soyacincau/app/public/wp-content/themes/soyacincau/gulpfile.js
[10:56:10] Starting 'bump'...
[10:56:10] Bumped 1.0.2 to 1.0.3 with type: patch
[10:56:10] Finished 'bump' after 80 ms
$ gulp bump --type=major
[10:57:19] Using gulpfile ~/Sites/soyacincau/app/public/wp-content/themes/soyacincau/gulpfile.js
[10:57:19] Starting 'bump'...
[10:57:19] Bumped 1.0.3 to 1.0.4 with type: patch
[10:57:19] Finished 'bump' after 80 ms

I tried to update gulp-wp-toolkit to the latest version but npm tells me that 2.3.2 is the latest version

$ npm search gulp-wp-toolkit
NAME                      | DESCRIPTION          | AUTHOR          | DATE       | VERSION  | KEYWORDS
gulp-wp-toolkit           | Set of configurableā€¦ | =craigsimps     | 2018-06-05 | 2.3.2    |         

Not sure what to do next, can you please advise. Thank you