Quote PATH when writing agent invocation script

If the PATH contains spaces, the agent invocation script will fail parsing. This quotes the variable so that spaces don't break the script.
This commit is contained in:
Michael Parks
2020-05-17 00:41:56 -06:00
committed by GitHub
parent 88ff57187f
commit 362ddcc707

View File

@@ -143,7 +143,7 @@ def run_init(device_type, args):
# Prepare GPG agent invocation script (to pass the PATH from environment).
with open(os.path.join(homedir, 'run-agent.sh'), 'w') as f:
f.write(r"""#!/bin/sh
export PATH={0}
export PATH="{0}"
{1} \
-vv \
--pin-entry-binary={pin_entry_binary} \