stephenlacy/gulp-bump

Q: Version as object?

Closed this issue · 2 comments

I'm currently working with a file that maintains the version, annoyingly, as an object instead of the standard string. My assumption is that the way this file structures the version value is invalid, and correspondingly can't be bumped with this gulp-bump plugin.

Below is an example of what one of these files looks like, emphasis on version. Note that we can not change the schema either unfortunately.

{
  "name": "test",
  "version": {
    "Major": "0",
    "Minor": "2",
    "Patch": "1"
   },
  "description": "foobar",
  "author": "me",
}

Am I correct that this is an invalid version representation (and thus un-bumpable), or is there some way I can configure gulp-bump to handle this odd scenario?

You could use the underlying module and parse the returned output, you would need to write a custom function for parsing the input values.
https://github.com/stevelacy/bump-regex

Thanks for the quick response and the suggestion! The only way we were able to get it to work was to write some custom code, just like you suggested. Thought I'd double check before we duplicated any functionality available here, but will go ahead and close this now.