Build Systems (sublimetext.com)
When formatting commands with massive arguments, array of string is helpful to format the strings.
Build Systems (sublimetext.com)
When formatting commands with massive arguments, array of string is helpful to format the strings.
It will be passed to the shell, as is. Converting an array of string to a string depends on what the shell is.
But in the exec.py in the bundled package, if the value is a array and it’s “cmd”, it simply just joins the strings, this could also be applied to shell_cmd
if shell_cmd:
print("Running " + shell_cmd)
elif cmd:
cmd_string = cmd
if not isinstance(cmd, str):
cmd_string = " ".join(cmd)
print("Running " + cmd_string)
sublime.status_message(“Building”)
But if cmd
is simply concatenating them with a space, then why don’t you just use cmd
?
Shell constructs such as piping and redirection are not supported – see "shell_cmd"
.
Probably cmd
doesn’t invokes a shell, but shell_cmd
does.
OK. I think your request is reasonable.
But in the exec.py in the bundled package, if the value is a array and it’s “cmd”, it simply just joins the strings, this could also be applied to shell_cmd
The strings are joined to show a status message only. Fundamentally running a shell command and running a process with arguments are different operations. Take for instance "cmd": ["rm", "foo bar.txt"]
will delete the file names “foo bar.txt”. If you joined that and passed it to a shell it would delete 2 files “foo” and “bar.txt”. This is why "shell_cmd"
only allows passing a string.