karlfreeman / middleman-deploy

Deploy a middleman built site over rsync, ftp, stfp, or git (e.g. gh-pages on github).
MIT License
553 stars 124 forks source link

Add option to skip publish if commit is empty #102

Open mojavelinux opened 9 years ago

mojavelinux commented 9 years ago

If the commit is empty (because there were no changes to the published files), it would be nice if there were a way to skip the commit. Currently, it's pushing an empty commit.

run_or_fail("git commit --allow-empty -am \"#{message}\"")

Perhaps an option like allow_empty_commit:

activate :deploy do |deploy|
  deploy.deploy_method = :git
  deploy.allow_empty_commit = false
end