From ad8d55d8ca12e1c3c7be0a30eb1c41bb589a13e2 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 12 Dec 2016 13:40:18 +0100 Subject: [PATCH] Update terminal-notifier.rb Fixes a bug that causes arguments starting with "-" to not be recognized --- Ruby/lib/terminal-notifier.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ruby/lib/terminal-notifier.rb b/Ruby/lib/terminal-notifier.rb index c18af87..14feb9b 100644 --- a/Ruby/lib/terminal-notifier.rb +++ b/Ruby/lib/terminal-notifier.rb @@ -16,7 +16,7 @@ def self.version def self.execute(verbose, options) if available? - command = [BIN_PATH, *options.map { |k,v| v = v.to_s; ["-#{k}", "#{Shellwords.escape(v[0,1])}#{v[1..-1]}"] }.flatten] + command = [BIN_PATH, *options.map { |k,v| v = v.to_s; ["-#{k}", "#{v[0] == "-" ? " " : ""}#{Shellwords.escape(v[0,1])}#{v[1..-1]}"] }.flatten] command = Shellwords.join(command) if RUBY_VERSION < '1.9' result = '' IO.popen(command) do |stdout|