Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Create Kumade::Git#add_and_commit_all_in

  • Loading branch information...
commit 1e575fac1fb33a6629e24c41ef720f9a6ba49366 1 parent 535b1f6
@tapajos tapajos authored
Showing with 7 additions and 4 deletions.
  1. +1 −4 lib/kumade/deployer.rb
  2. +6 −0 lib/kumade/git.rb
View
5 lib/kumade/deployer.rb
@@ -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
View
6 lib/kumade/git.rb
@@ -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?
Please sign in to comment.
Something went wrong with that request. Please try again.