mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix: ctest prints command line that is not copy-pasteable
If you use BLENDER_VERBOSE=1, ctest prints out the blender command line that was invoked, but it would fail if you just copy/pasted it into a command prompt, because the "python-expr" argument contained spaces. This fix surrounds the "python-expr" argument with quote marks, so you can copy/paste it without modification. Tested on Windows Command Prompt, Powershell and nushell. Pull Request: https://projects.blender.org/blender/blender/pulls/147537
This commit is contained in:
parent
18d879b5aa
commit
14908ce174
1 changed files with 14 additions and 1 deletions
|
|
@ -575,7 +575,20 @@ class Report:
|
|||
crash = True
|
||||
|
||||
if verbose:
|
||||
print(" ".join(command))
|
||||
def quote_expr_args(cmd):
|
||||
quoted = []
|
||||
quote_next = False
|
||||
for arg in cmd:
|
||||
if quote_next:
|
||||
quoted.append('"{}"'.format(arg)) # wrap the expression in quotes
|
||||
quote_next = False
|
||||
else:
|
||||
quoted.append(arg)
|
||||
if arg == "--python-expr":
|
||||
quote_next = True
|
||||
return quoted
|
||||
print(' '.join(quote_expr_args(command)))
|
||||
|
||||
if (verbose or crash) and output:
|
||||
print(output.decode("utf-8", 'ignore'))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue