Class: CfnFlow::Git
- Inherits:
-
Object
- Object
- CfnFlow::Git
- Defined in:
- lib/cfn_flow/git.rb
Overview
Git helper module TODO: extract as plugin
Class Method Summary collapse
Class Method Details
.check_status ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/cfn_flow/git.rb', line 15 def check_status unless `git status -s`.empty? raise Thor::Error.new("Git working directory is not clean. Please commit or reset changes in order to release.") end unless $?.success? raise Thor::Error.new("Error running `git status`") end end |
.sha ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/cfn_flow/git.rb', line 6 def sha command = "git rev-parse --verify HEAD" result = `#{command}`.chomp unless $?.success? raise Thor::Error.new("Error running `#{command}`") end result end |