Support bumping version in multiple config files #73

Closed
wants to merge 3 commits into
from

Conversation

Projects
None yet
6 participants

Add a new "files" property which can be set to an array of JSON files. Each should contain a "version" property. On release, the bump() function now updates the "version" property in each file.

The "file" option is maintained for backwards-compatibility, but is ignored if "files" is set.

Fixes #56

Elliot Smith added some commits Mar 11, 2014

Add support for multiple config files to bump
Added a new "files" property which can be set to an array of file
paths for files whose version property should be bumped.

The first file in the array is treated as the "primary", and all
the versions in the other files are synchronised to whatever the
primary's version is set to.

If "files" is set, the "file" property is ignored; however, if only
"file" is set, the version is bumped in that one file (maintained for
backwards-compatibility).

I just read through the various related threads I hadn't noticed before on this topic. For me, it makes sense to synchronise bower and package and whatever other JSON config files you've got, and put them on the same version number. That's what I've implemented here. And I'm not sure I want to run grunt-release multiple times: I'm happy for it to just do the npm publish step, as bower will sort itself out, providing there are github tags. So a multi-task seems overkill. But, anyway, here's a suggested implementation which keeps things simple.

I need this feature for https://github.com/stefanpenner/ember-cli. We generate a package.json for the user that includes our library as a dependency. On release, we need to update both our own config & the blueprint one. I'm going to use this fork for now I guess, but it would be nice it this (or something like it) could get pulled in. @geddski

Wait, scratch my above comment. This doesn't actually help my use case at all. Sorry about that!

@audreyr audreyr referenced this pull request in audreyr/messagebar Apr 22, 2014

Open

Set up with grunt-release #2

👍 I need this to update both package.json and bower.json.

2fdevs commented May 18, 2014

+1

aq1018 commented Jun 18, 2014

@geddski Do you mind merging this in? Would be very useful for my use case as well.

aq1018 commented Jun 18, 2014

Just pulled from townxelliot:multiple-files-56 and ran npm test and it passed. (FYI)

Collaborator

drublic commented Dec 3, 2014

@townxelliot Thanks for all the work. I landed #91 which is another implementation of this feature. It would be awesome if we could land your tests and documentation.
Please feel free to open another PR or update this if you think this is still important.

@drublic drublic closed this Dec 3, 2014

@drublic drublic reopened this Dec 3, 2014

@drublic drublic closed this Jan 5, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment