Fix SystemCommand escaping … again.
This commit is contained in:
parent
1b28922628
commit
76c64f9bbf
@ -50,11 +50,7 @@ module Hbc
|
|||||||
end
|
end
|
||||||
|
|
||||||
def command
|
def command
|
||||||
@command ||= if sudo?
|
|
||||||
[*sudo_prefix, executable, *args]
|
[*sudo_prefix, executable, *args]
|
||||||
else
|
|
||||||
[Shellwords.shellescape(executable), *args]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
@ -85,8 +81,10 @@ module Hbc
|
|||||||
end
|
end
|
||||||
|
|
||||||
def each_output_line(&b)
|
def each_output_line(&b)
|
||||||
|
executable, *args = expanded_command
|
||||||
|
|
||||||
raw_stdin, raw_stdout, raw_stderr, raw_wait_thr =
|
raw_stdin, raw_stdout, raw_stderr, raw_wait_thr =
|
||||||
Open3.popen3(*expanded_command, **options)
|
Open3.popen3([executable, executable], *args, **options)
|
||||||
|
|
||||||
write_input_to(raw_stdin)
|
write_input_to(raw_stdin)
|
||||||
raw_stdin.close_write
|
raw_stdin.close_write
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user