From 6d65ec3afb751464e8e49c5ca9257063320274e2 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 16 Aug 2023 11:18:26 +0100 Subject: [PATCH] service: correctly quote arguments. 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. --- Library/Homebrew/service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/service.rb b/Library/Homebrew/service.rb index 99b23a8620df5..a205d56972c2a 100644 --- a/Library/Homebrew/service.rb +++ b/Library/Homebrew/service.rb @@ -398,7 +398,7 @@ def manual_command vars = @environment_variables.except(:PATH) .map { |k, v| "#{k}=\"#{v}\"" } - out = vars + command if command? + out = vars + T.must(command).map { |arg| Utils::Shell.sh_quote(arg) } if command? out.join(" ") end