5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/t1k/commands/commit.rb', line 5
def self.run(message, close, add, no_message)
message ||= ""
text_close = ''
raise "Message can't be blank. Use --no-message to ignore this rule." if message.empty? && !no_message
branch = `git branch | grep '*' | awk '{print $2}'`
text_close = close ? 'close ' : 'ref'
if close
text_close = 'close '
end
text_add = add ? 'a' : ''
system "git commit -#{text_add}m '[#{text_close}##{branch.strip}] #{message}'"
end
|