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#remote_exists?
Browse files Browse the repository at this point in the history
  • Loading branch information
tapajos committed Aug 29, 2011
1 parent e5720d4 commit e4c165d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
10 changes: 1 addition & 9 deletions lib/kumade/deployer.rb
Expand Up @@ -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
Expand All @@ -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
8 changes: 8 additions & 0 deletions lib/kumade/git.rb
Expand Up @@ -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?
Expand Down

0 comments on commit e4c165d

Please sign in to comment.