lib/middleman-deploy/strategies/git/force_push.rb in middleman-deploy-0.2.4 vs lib/middleman-deploy/strategies/git/force_push.rb in middleman-deploy-0.3.0

- old
+ new

@@ -1,25 +1,24 @@ module Middleman module Deploy module Strategies module Git class ForcePush < Base - def process Dir.chdir(self.build_dir) do add_remote_url checkout_branch commit_branch('-f') end end - private + private def add_remote_url url = get_remote_url - unless File.exists?('.git') + unless File.exist?('.git') `git init` `git remote add origin #{url}` else # check if the remote repo has changed unless url == `git config --get remote.origin.url`.chop @@ -44,10 +43,9 @@ exit end url end - end end end end end