class Object
Public Instance Methods
check(keyword)
click to toggle source
# File lib/ggsm/hook/commit-msg, line 15 def check(keyword) if @msg.start_with? keyword exit 0 end end
commit_check()
click to toggle source
# File lib/ggsm/hook/commit-msg, line 6 def commit_check standards = %w(fix: fix: feat: feat: style: style: doc: doc: docs: docs: ref: ref: refactor: refactor: chore: chore: test: test: Merge merge Revert revert) standards.each do |standard| check(standard) end puts '==> commit message不符合规范,请查看规范:https://doc.souche-inc.com/pages/viewpage.action?pageId=6037872!'.red exit 1 end
switch_dir()
click to toggle source
# File lib/ggsm/hook/pre-commit, line 4 def switch_dir if File.directory?('.git') return end Dir.chdir '..' switch_dir end