Skip to content
Browse files

Only pass the -c option to $EDITOR if it's vim

So that emacs will work.
  • Loading branch information...
1 parent 12e3524 commit 1f09373459d4ace0172d85e20f154c23e23e492e @danielbeardsley danielbeardsley committed Aug 15, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 github.rb
View
9 github.rb
@@ -124,7 +124,14 @@ def self.get_pull_request_description(branch_name = nil)
msg.write(initial_message)
msg.close
- system("$EDITOR -c \":set filetype=gitcommit\" #{msg.path.shellescape}")
+ # -c blah only works for vim
+ if (ENV['EDITOR'].include?('vim'))
+ opts = "-c \":set filetype=gitcommit\""
+ else
+ opts = ""
+ end
+
+ system("$EDITOR #{opts} #{msg.path.shellescape}")
full_message = File.open(msg.path, "r").read
lines = full_message.split("\n")
lines = lines.reject {|line| line =~ /^\s*#/ }

0 comments on commit 1f09373

Please sign in to comment.
Something went wrong with that request. Please try again.