Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

Commit

Permalink
Create Kumade::Git#add_and_commit_all_in
Browse files Browse the repository at this point in the history
  • Loading branch information
tapajos committed Aug 29, 2011
1 parent 535b1f6 commit 1e575fa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 1 addition & 4 deletions lib/kumade/deployer.rb
Expand Up @@ -106,10 +106,7 @@ def invoke_custom_task
end

def git_add_and_commit_all_assets_in(dir)
run_or_error ["git checkout -b #{DEPLOY_BRANCH}", "git add -f #{dir}", "git commit -m 'Compiled assets'"],
"Cannot deploy: couldn't commit assets"

success "Added and committed all assets"
@git.add_and_commit_all_in(dir, DEPLOY_BRANCH, 'Compiled assets', "Added and committed all assets", "couldn't commit assets")
end

def jammit_assets_path
Expand Down
6 changes: 6 additions & 0 deletions lib/kumade/git.rb
Expand Up @@ -27,6 +27,12 @@ def delete(branch_to_delete, branch_to_checkout)
"Failed to clean up #{branch_to_delete} branch")
end

def add_and_commit_all_in(dir, branch, commit_message, success_output, error_output)
run_or_error ["git checkout -b #{branch}", "git add -f #{dir}", "git commit -m '#{commit_message}'"],
"Cannot deploy: #{error_output}"
success success_output
end

def git_dirty?
`git diff --exit-code`
!$?.success?
Expand Down

0 comments on commit 1e575fa

Please sign in to comment.