mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 14:30:09 +01:00
fix grep regression
This commit is contained in:
parent
b5df665251
commit
43fe8df1fd
3 changed files with 30 additions and 29 deletions
|
|
@ -285,21 +285,23 @@ def grep(
|
|||
)
|
||||
sys.exit(1)
|
||||
else:
|
||||
if is_version_pattern_required:
|
||||
normalize_pattern = v2patterns.normalize_pattern(version_pattern, raw_pattern)
|
||||
else:
|
||||
normalize_pattern = raw_pattern
|
||||
version_pattern = "vYYYY0M.BUILD[-RELEASE]"
|
||||
|
||||
if is_version_pattern_required:
|
||||
normalized_pattern = v2patterns.normalize_pattern(version_pattern, raw_pattern)
|
||||
else:
|
||||
normalized_pattern = raw_pattern
|
||||
|
||||
isatty = getattr(sys.stdout, 'isatty', lambda: False)
|
||||
|
||||
if isatty():
|
||||
colorama.init()
|
||||
try:
|
||||
_grep(normalize_pattern, files, color=True)
|
||||
_grep(normalized_pattern, files, color=True)
|
||||
finally:
|
||||
colorama.deinit()
|
||||
else:
|
||||
_grep(normalize_pattern, files, color=False)
|
||||
_grep(normalized_pattern, files, color=False)
|
||||
|
||||
|
||||
@cli.command()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue