Expand env vars throughout command lines

When converting strings to command lines interpret env vars in all the
parts of the command line not just the first item. Fixes #1535
This commit is contained in:
Kovid Goyal 2019-04-13 13:53:32 +05:30
parent 8969206450
commit 5953c2097d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -37,9 +37,8 @@ def to_bool(x):
def to_cmdline(x): def to_cmdline(x):
ans = shlex.split(x) return list(map(
ans[0] = os.path.expandvars(os.path.expanduser(ans[0])) lambda y: os.path.expandvars(os.path.expanduser(y)), shlex.split(x)))
return ans
def python_string(text): def python_string(text):