env var write: add missing newline_separator back

This commit is contained in:
Ciro Santilli
2018-08-31 09:47:02 +01:00
parent 3a5d85f38b
commit eb3422c1ea

View File

@@ -154,8 +154,12 @@ def get_stats(stat_re=None, stats_file=None):
def print_cmd(cmd, cmd_file=None, extra_env=None):
"""
Format a command given as a list of strings so that it can
be viewed nicely and executed by bash directly.
be viewed nicely and executed by bash directly and print it to stdout.
Optionally save the command to cmd_file file, and add extra_env
environment variables to the command generated.
"""
newline_separator = ' \\\n'
out = []
for key in extra_env:
out.extend(['{}={}'.format(shlex.quote(key), shlex.quote(extra_env[key])), newline_separator])