Update utils.py

In windows mutiline command should like
command --arg1 xxx `
--arg2 xxx `
This commit is contained in:
marko1616 2024-07-06 20:40:13 +08:00 committed by GitHub
parent 53b1002fb7
commit e0562521bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -113,7 +113,10 @@ def gen_cmd(args: Dict[str, Any]) -> str:
for k, v in clean_cmd(args).items():
cmd_lines.append(" --{} {} ".format(k, str(v)))
cmd_text = "\\\n".join(cmd_lines)
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