Permalink
Browse files

Create Kumade::Git#delete

  • Loading branch information...
1 parent dd449f1 commit d5ddc1309d5dfe5dbae6566c1589fb57f18e79cd @tapajos tapajos committed Aug 29, 2011
Showing with 6 additions and 2 deletions.
  1. +1 −2 lib/kumade/deployer.rb
  2. +5 −0 lib/kumade/git.rb
@@ -43,8 +43,7 @@ def heroku_migrate
end
def post_deploy
- run_or_error(["git checkout #{@branch}", "git branch -D #{DEPLOY_BRANCH}"],
- "Failed to clean up #{DEPLOY_BRANCH} branch")
+ @git.delete(DEPLOY_BRANCH, @branch)
end
def heroku(command, app)
View
@@ -21,6 +21,11 @@ def create(branch)
run_or_error("git branch #{branch}", "Failed to create #{branch}")
end
end
+
+ def delete(branch_to_delete, branch_to_checkout)
+ run_or_error(["git checkout #{branch_to_checkout}", "git branch -D #{branch_to_delete}"],
+ "Failed to clean up #{branch_to_delete} branch")
+ end
def run_or_error(commands, error_message)
all_commands = [commands].flatten.join(' && ')

0 comments on commit d5ddc13

Please sign in to comment.