Update utils.py

In windows mutiline command should like
command --arg1 xxx `
--arg2 xxx `

Former-commit-id: e0562521bbd7cf6b3b90f8c87e52690931f736bd
This commit is contained in:
marko1616 2024-07-06 20:40:13 +08:00 committed by GitHub
parent 7fcffb860d
commit c8205c5163

View File

@ -113,6 +113,9 @@ def gen_cmd(args: Dict[str, Any]) -> str:
for k, v in clean_cmd(args).items():
cmd_lines.append(" --{} {} ".format(k, str(v)))
if os.name == "nt":
cmd_text = "`\n".join(cmd_lines)
else:
cmd_text = "\\\n".join(cmd_lines)
cmd_text = "```bash\n{}\n```".format(cmd_text)
return cmd_text