diff options
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/system_command.rb')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/system_command.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/system_command.rb b/Library/Homebrew/cask/lib/hbc/system_command.rb index ea440991f..f64d85c07 100644 --- a/Library/Homebrew/cask/lib/hbc/system_command.rb +++ b/Library/Homebrew/cask/lib/hbc/system_command.rb @@ -1,5 +1,6 @@ require "open3" require "vendor/plist/plist" +require "shellwords" require "extend/io" @@ -49,11 +50,11 @@ module Hbc end def command - @command ||= [ - *sudo_prefix, - executable, - *args, - ].freeze + @command ||= if sudo? + [*sudo_prefix, executable, *args] + else + [Shellwords.shellescape(executable), *args] + end end private |
