Permalink
Browse files

It can now use TM_GIT environment variable to know where is git insta…

…lled
  • Loading branch information...
1 parent 69ff839 commit 59c164b05ec2505fb045c76037c3c1d3cee79672 @ivanvc committed Jul 2, 2009
Showing with 4 additions and 4 deletions.
  1. +2 −2 Commands/Private Gist.tmCommand
  2. +2 −2 Commands/Public Gist.tmCommand
@@ -12,8 +12,8 @@ require 'uri'
contents = `/usr/bin/env cat #{ENV['TM_FILEPATH']}` unless ENV['TM_SELECTED_TEXT']
-login = `/usr/bin/env git config --global --get github.user`.chomp
-token = `/usr/bin/env git config --global --get github.token`.chomp
+login = `#{ENV['TM_GIT'] || "/usr/bin/env git"} config --global --get github.user`.chomp
+token = `#{ENV['TM_GIT'] || "/usr/bin/env git"} config --global --get github.token`.chomp
response = Net::HTTP.post_form(URI.parse('http://gist.github.com/api/v1/xml/new'), { "files[#{ENV['TM_FILENAME']}]" => ENV['TM_SELECTED_TEXT'] || contents, "private" => true, "login" => login, "token" => token })
@@ -12,8 +12,8 @@ require 'uri'
contents = `/usr/bin/env cat #{ENV['TM_FILEPATH']}` unless ENV['TM_SELECTED_TEXT']
-login = `/usr/bin/env git config --global --get github.user`.chomp
-token = `/usr/bin/env git config --global --get github.token`.chomp
+login = `#{ENV['TM_GIT'] || "/usr/bin/env git"} config --global --get github.user`.chomp
+token = `#{ENV['TM_GIT'] || "/usr/bin/env git"} config --global --get github.token`.chomp
response = Net::HTTP.post_form(URI.parse('http://gist.github.com/api/v1/xml/new'), { "files[#{ENV['TM_FILENAME']}]" => ENV['TM_SELECTED_TEXT'] || contents, "login" => login, "token" => token })

0 comments on commit 59c164b

Please sign in to comment.