I am trying to create an alias on Ruby:
#!/usr/bin/env ruby
if ARGV[0]
`git add -A && git commit -m #{ARGV[0]} && git push`
else
`git add -A && EDITOR='TERM=xterm vim' git commit && git push`
end
I tried first without EDITOR...
, but any thing I try I get Vim: Warning: Output is not to a terminal
.
What I want is vim to appear when I do not enter any commit message. But instead I get that message.
Update
I think what I need is to capture editor output as git does. How could I do that?