Skip to content

Commit

Permalink
Raise if pattern is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Nov 24, 2021
1 parent 0a67a22 commit fda0358
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/bump-version.py
Expand Up @@ -30,6 +30,8 @@
def replace_in_file(path, pattern, replacement):
source = path.read_text(**ENC)
replaced = re.sub(pattern, replacement, source)
if replaced == source:
raise ValueError("pattern not found")
path.write_text(replaced, **ENC)


Expand Down

0 comments on commit fda0358

Please sign in to comment.