Skip to content

Commit

Permalink
update configuration loading
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiscode committed Jun 28, 2024
1 parent 2d793e7 commit 79c0663
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/text_utils/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@

def _replace_env(s: str, _: str) -> str:
env_regex = re.compile(r"env\(([A-Z0-9_]+):?(.*?)\)")
matches = list(env_regex.finditer(s))
if len(matches) == 0:
return s

org_length = len(s)
length_change = 0
for match in env_regex.finditer(s):
for match in matches:
env_var, env_default = match.group(1), match.group(2)
if env_var not in os.environ:
if env_default == "":
Expand Down

0 comments on commit 79c0663

Please sign in to comment.