Merge pull request #11956 from benpbolton/patch-1
Wrap mac 'brew info' multi-word service command parameters in single quotes
This commit is contained in:
commit
f5a4214a70
@ -37,7 +37,14 @@ class Caveats
|
||||
|
||||
if f.plist_manual || f.service?
|
||||
command = if f.service?
|
||||
f.service.command.join(" ")
|
||||
f.service
|
||||
.command
|
||||
.map do |arg|
|
||||
next arg unless arg.match?(/\s/)
|
||||
|
||||
# quote multi-word arguments
|
||||
"'#{arg}'"
|
||||
end.join(" ")
|
||||
else
|
||||
f.plist_manual
|
||||
end
|
||||
|
||||
@ -128,6 +128,20 @@ describe Caveats do
|
||||
expect(caveats).to include("background service")
|
||||
end
|
||||
|
||||
it "wraps multi-word service parameters" do
|
||||
f = formula do
|
||||
url "foo-1.0"
|
||||
service do
|
||||
run [bin/"nginx", "-g", "daemon off;"]
|
||||
end
|
||||
end
|
||||
caveats = described_class.new(f).caveats
|
||||
|
||||
expect(f.service?).to eq(true)
|
||||
expect(caveats).to include("#{f.bin}/nginx -g 'daemon off;'")
|
||||
expect(caveats).to include("background service")
|
||||
end
|
||||
|
||||
it "warns about brew failing under tmux" do
|
||||
f = formula do
|
||||
url "foo-1.0"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user