Skip to content

Commit

Permalink
service: correctly quote arguments.
Browse files Browse the repository at this point in the history
If you have a run argument with a space in it: it will need to be quoted
to be passed through correctly when run as a manual command.

Fixes #15871.
  • Loading branch information
MikeMcQuaid committed Aug 16, 2023
1 parent 4c87937 commit a6f5781
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Library/Homebrew/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def manual_command
vars = @environment_variables.except(:PATH)
.map { |k, v| "#{k}=\"#{v}\"" }

out = vars + command if command?
out = vars + command.map { |arg| Utils::Shell.sh_quote(arg) } if command?
out.join(" ")
end

Expand Down

0 comments on commit a6f5781

Please sign in to comment.