Merge pull request #77 from mconnell/master
Prevent bad commits deploying. (git)
This commit is contained in:
commit
217af0d33c
1 changed files with 8 additions and 3 deletions
|
@ -37,9 +37,14 @@ module Middleman
|
|||
def commit_branch(options = '')
|
||||
message = self.commit_message ? self.commit_message : add_signature_to_commit_message('Automated commit')
|
||||
|
||||
`git add -A`
|
||||
`git commit --allow-empty -am "#{message}"`
|
||||
`git push #{options} origin #{self.branch}`
|
||||
run_or_fail("git add -A")
|
||||
run_or_fail("git commit --allow-empty -am \"#{message}\"")
|
||||
run_or_fail("git push #{options} origin #{self.branch}")
|
||||
end
|
||||
|
||||
private
|
||||
def run_or_fail(command)
|
||||
system(command) || raise("ERROR running: #{command}")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue