mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 06:20:08 +01:00
better error message
This commit is contained in:
parent
42dac604b9
commit
17cc0f97a7
1 changed files with 6 additions and 1 deletions
|
|
@ -186,7 +186,12 @@ def diff(new_version: str, file_patterns: config.PatternsByGlob) -> str:
|
||||||
with file_path.open(mode="rt", encoding="utf-8") as fh:
|
with file_path.open(mode="rt", encoding="utf-8") as fh:
|
||||||
content = fh.read()
|
content = fh.read()
|
||||||
|
|
||||||
rfd = rfd_from_content(pattern_strs, new_version, content)
|
try:
|
||||||
|
rfd = rfd_from_content(pattern_strs, new_version, content)
|
||||||
|
except ValueError:
|
||||||
|
errmsg = f"No patterns matched for '{file_path}'"
|
||||||
|
raise ValueError(errmsg)
|
||||||
|
|
||||||
rfd = rfd._replace(path=str(file_path))
|
rfd = rfd._replace(path=str(file_path))
|
||||||
lines = diff_lines(rfd)
|
lines = diff_lines(rfd)
|
||||||
if len(lines) == 0:
|
if len(lines) == 0:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue