Skip to content

Commit

Permalink
Merge pull request #77 from mconnell/master
Browse files Browse the repository at this point in the history
Prevent bad commits deploying. (git)
  • Loading branch information
karlfreeman committed Nov 21, 2014
2 parents 8a0bfae + 79d86af commit 217af0d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/middleman-deploy/strategies/git/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,14 @@ def checkout_branch
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
Expand Down

0 comments on commit 217af0d

Please sign in to comment.