mirror of
https://github.com/armbian/automount.git
synced 2026-01-06 11:42:57 -08:00
util::subst_vars: emulate shell behaviour
This commit is contained in:
2
util.py
2
util.py
@@ -26,7 +26,7 @@ def split_quoted(s):
|
||||
|
||||
def subst_vars(s, env):
|
||||
pattern = re.compile(r'\$\{([^}]+)\}')
|
||||
return re.sub(pattern, lambda match: env.get(match.group(1), match.group(0)), s)
|
||||
return re.sub(pattern, lambda match: env.get(match.group(1), ""), s)
|
||||
|
||||
def run(args, env={}):
|
||||
if isinstance(args, str):
|
||||
|
||||
Reference in New Issue
Block a user