Skip to content

Commit

Permalink
Update terminal-notifier.rb
Browse files Browse the repository at this point in the history
Fixes a bug that causes arguments starting with "-" to not be recognized
  • Loading branch information
iRath96 authored Dec 12, 2016
1 parent e9b78b0 commit ad8d55d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Ruby/lib/terminal-notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down

0 comments on commit ad8d55d

Please sign in to comment.