aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/compat/hbc
diff options
context:
space:
mode:
authorMarkus Reiter2017-10-24 18:28:21 +0200
committerMarkus Reiter2017-10-30 22:04:54 +0100
commit2eb366ff386674bcd2eec760fdaef25dff665063 (patch)
tree856de5e7819f69bcf0adde4761729c59a85c232d /Library/Homebrew/compat/hbc
parent2d5bb029a51f17d15ee6a61160297a748c28f6be (diff)
downloadbrew-2eb366ff386674bcd2eec760fdaef25dff665063.tar.bz2
Fix `SystemCommand` without arguments.
Diffstat (limited to 'Library/Homebrew/compat/hbc')
-rw-r--r--Library/Homebrew/compat/hbc/system_command.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/Library/Homebrew/compat/hbc/system_command.rb b/Library/Homebrew/compat/hbc/system_command.rb
new file mode 100644
index 000000000..bb9187db3
--- /dev/null
+++ b/Library/Homebrew/compat/hbc/system_command.rb
@@ -0,0 +1,18 @@
+require "shellwords"
+
+module SystemCommandCompatibilityLayer
+ def initialize(executable, args: [], **options)
+ if args.empty? && !File.exist?(executable)
+ odeprecated "`system_command` with a shell string", "`system_command` with the `args` parameter"
+ executable, *args = Shellwords.shellsplit(executable)
+ end
+
+ super(executable, args: args, **options)
+ end
+end
+
+module Hbc
+ class SystemCommand
+ prepend SystemCommandCompatibilityLayer
+ end
+end