Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow wildcards in [bumpversion:file:...] #104

Open
louisl opened this issue Jul 17, 2015 · 8 comments
Open

Allow wildcards in [bumpversion:file:...] #104

louisl opened this issue Jul 17, 2015 · 8 comments

Comments

@louisl
Copy link

louisl commented Jul 17, 2015

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.

@peritus
Copy link
Owner

peritus commented Jul 17, 2015

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 :)

@louisl
Copy link
Author

louisl commented Jul 17, 2015

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.

@peritus
Copy link
Owner

peritus commented Jul 17, 2015

@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 ?

@louisl
Copy link
Author

louisl commented Jul 17, 2015

@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.

@peritus peritus changed the title Can I specify a directory in .bumpversion.cfg? Allow wildcards in [bumpversion:file:...] Oct 30, 2015
@jackmaney
Copy link

jackmaney commented Oct 3, 2017

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.

@jackmaney
Copy link

jackmaney commented Oct 3, 2017

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...)

@lorengordon
Copy link

@jackmaney you ever get a PR for this? Or is your work available in a fork/branch?

@jqadev
Copy link

jqadev commented Jan 21, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants