--dir skips glob-matched files but still bumps the config

Open Beginner friendly
#9 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli

Research direction

Start from the --dir handling and glob file matching, then trace how the working directory is passed to glob resolution. Reproduce the issue by running bumpversion --dir proj patch from the parent directory with the shown config and compare it with a run from inside proj. Done means pkgs/a/VERSION and current_version both become 1.0.1 when invoked from the parent.

Written by the indexing model from the issue text.

Description

bug

With --dir, files matched by a glob are skipped without a warning, while the config's current_version is still bumped:

$ # proj/.bumpversion.toml: current_version = "1.0.0", files = [{ glob = "pkgs/*/VERSION" }]
$ # proj/pkgs/a/VERSION contains 1.0.0
$ bumpversion --dir proj patch      # run from proj's parent
$ echo $?
0
$ cat proj/pkgs/a/VERSION
1.0.0
$ grep current proj/.bumpversion.toml
current_version = "1.0.1"

Run from inside proj, the same config bumps pkgs/a/VERSION. So the glob seems to resolve against the current directory rather than the --dir directory. The result is a config and files that disagree, with exit status 0.

Expected: resolve globs against the repository directory --dir names. A glob that matches nothing could also deserve a warning.

Dominant language
Rust
Stars
1
Forks
0
Avg merge
12m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from romnn/bumpversion

All issues in romnn/bumpversion

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.