Open louisl opened 9 years ago
You mean as in
[bumpversion:file:path/to/source/*.php]
would expand and match
path/to/source/a_file.php
path/to/source/a_second_file.php
path/to/source/another_file.php
path/to/source/file_that_does_not_start_with_a.php
?
No, it doesn't work that way at the moment, you'd have to specify all the files individually in the configuration.
I like the idea though, pull requests welcome :)
Yes, thats what I need.
I have the config working on all the unique files but it'll be back to the old find and replace on folders for now then :)
Thanks for the quick reply.
@louisl
back to the old find and replace on folders for now then
You have folders that have version numbers in their names or am I misunderstanding this ?
@peritus No not in the folders names, this is for a website so the version is in the header doc blocks of each php and js file and in a constants file as a variable. Also it's in bower.json, composer.json, package.json. So on a version bump I need to update a lot of places.
I'm currently working on this, by first trying the builtin glob
library, and if that fails (because glob
doesn't expand everything that a shell can, eg curly brackets) then calls the shell via subprocess.check_output
. What I have seems to be working. Currently reading through the unit tests and adding some tests for multiple files via globs. I should have a PR ready within a few days or so.
Incidentally, do you mind if I refactor the 1864 line tests/test_cli.py
module into some separate modules containing related tests?
~Also, do you mind if I cleanup tmpdir
after each test that uses it (so I don't have to worry about which files already exist within it)?~ (Nevermind, just looked at the pytest
docs and saw that tmpdir
is unique per test function invocation...)
@jackmaney you ever get a PR for this? Or is your work available in a fork/branch?
This feature is strongly needed, because specifying all the files individually in the configuration is uncomfortable and time-consuming when working on large projects.
@jackmaney what is the state of your PR?
Can I specify folders in .bumpversion.cfg?,
I'm trying to use this to update all the @version x.x.x php doc block tags in specific folders in my project.