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

Support filepath globs for replacements #713

Closed
Magic-Mayo opened this issue Sep 9, 2024 · 3 comments · Fixed by #716
Closed

Support filepath globs for replacements #713

Magic-Mayo opened this issue Sep 9, 2024 · 3 comments · Fixed by #716
Labels
enhancement New feature or request

Comments

@Magic-Mayo
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When doing some replacements for projects I want to make the same change to many files. These files have the same name but are listed in separate directories. Instead of having to list each of those replacements it would be nice to just do something like path/to/**/file or path/to/*.ext or path/to/file.*.

Describe the solution you'd like
Using filepath globs would be a nice solution for this.

Describe alternatives you've considered
Listing out a replacement for every filepath...but that can get super tedious and is just waiting for a mistake.

Additional context
Similar to the last issue I opened this is while working with helm charts. I have many Chart.yaml files I want to modify when releasing a change to one of the charts. All the Chart.yaml files have the same basic structure and as such I'd like to be able to give a filepath glob to make a replacement on all of them, if necessary, when releasing a change to one. Given a file structure and a config in changie like the following I'd like it to be able to modify each Chart.yaml:

common/
|- Chart.yaml
other/
|- Chart.yaml
main/
|- Chart.yaml
projects:
  - label: Common
     key: common
     replacements:
       - path: ./**/Chart.yaml
          find: "version: .*"
          replace: "version: {{ .VersionNoPrefix }}"

A config like this should allow me to make changes to any Chart.yaml found in any subdirectory changie is currently working in.

@Magic-Mayo Magic-Mayo added the enhancement New feature or request label Sep 9, 2024
@miniscruff
Copy link
Owner

I kinda figured this would happen at some point lol.

I believe moving to glob search is fine.

@Magic-Mayo
Copy link
Contributor Author

I'm always happy to contribute where needed

@miniscruff
Copy link
Owner

I'm always happy to contribute where needed

Of course, PRs are appreciated. Let me know if you need any help.

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

Successfully merging a pull request may close this issue.

2 participants