We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 64624ed commit 60fbbd4Copy full SHA for 60fbbd4
1 file changed
script/remote-run-commands/customize.py
@@ -122,11 +122,15 @@ def preprocess(i):
122
123
ssh_cmd_str = " ".join(ssh_cmd)
124
125
- # Use double quotes on Windows, single quotes on Unix for better
126
- # compatibility
127
- quote_char = '"' if is_windows else "'"
128
- ssh_run_command = ssh_cmd_str + " " + user + "@" + host + \
129
- password_string + " " + quote_char + cmd_string + quote_char
+
+ if is_windows:
+ safe_cmd_string = subprocess.list2cmdline([cmd_string])
+ else:
+ safe_cmd_string = shlex.quote(cmd_string)
130
131
+ ssh_run_command = f"{ssh_cmd_str} {user}@{host} {password_string} {safe_cmd_string}"
132
133
134
env['MLC_SSH_CMD'] = ssh_run_command
135
136
# ---- Use sshpass if password is provided (only on Unix-like systems) ----
0 commit comments