Merge pull request #77 from mconnell/master

Prevent bad commits deploying. (git)
This commit is contained in:
Karl Freeman 2014-11-21 17:07:11 +00:00
commit 217af0d33c

View file

@ -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