Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Create Kumade::Git#remote_exists?

  • Loading branch information...
commit e4c165dc1538627b6ab5620ce482bdde007c119d 1 parent e5720d4
@tapajos tapajos authored
Showing with 9 additions and 9 deletions.
  1. +1 −9 lib/kumade/deployer.rb
  2. +8 −0 lib/kumade/git.rb
View
10 lib/kumade/deployer.rb
@@ -168,7 +168,7 @@ def success(message)
end
def ensure_heroku_remote_exists
- if remote_exists?(environment)
+ if @git.remote_exists?(environment)
if app_name = Kumade.app_for(environment)
success("#{environment} is a Heroku remote")
else
@@ -178,13 +178,5 @@ def ensure_heroku_remote_exists
error(%{Cannot deploy: "#{environment}" remote does not exist})
end
end
-
- def remote_exists?(remote_name)
- if pretending
- true
- else
- `git remote` =~ /^#{remote_name}$/
- end
- end
end
end
View
8 lib/kumade/git.rb
@@ -37,6 +37,14 @@ def current_branch
`git symbolic-ref HEAD`.sub("refs/heads/", "").strip
end
+ def remote_exists?(remote_name)
+ if @pretending
+ true
+ else
+ `git remote` =~ /^#{remote_name}$/
+ end
+ end
+
def git_dirty?
`git diff --exit-code`
!$?.success?
Please sign in to comment.
Something went wrong with that request. Please try again.