Skip to content

Commit

Permalink
Add get_clone_protocol method
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Oct 21, 2011
1 parent ea41868 commit a61279d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/App/gh/Command.pm
Expand Up @@ -54,6 +54,14 @@ sub get_current_repo {
}
}

sub get_clone_protocol {
my $self = shift;
return 'git' if $self->{protocol_git} ;
return 'ssh' if $self->{protocol_ssh} ;
return 'http' if $self->{protocol_http};
return 'https' if $self->{protocol_https};
return;
}

sub gen_uri {
my ($self,$acc,$repo) = @_;
Expand Down
3 changes: 3 additions & 0 deletions lib/App/gh/Command/All.pm
Expand Up @@ -19,6 +19,7 @@ sub options { (
"http" => "protocol_http", # http://github.com/c9s/repo.git
"https" => "protocol_https", # https://github.com/c9s/repo.git
"git|ro" => "protocol_git", # git://github.com/c9s/repo.git

"bare" => "bare",
"mirror" => "mirror",
"p|prefix=s" => "prefix",
Expand Down Expand Up @@ -98,6 +99,8 @@ sub run {
$local_repo_dir = "$local_repo_dir.git" if $self->{bare};
$local_repo_dir = $self->{prefix} . "-" . $local_repo_dir if $self->{prefix};



if( -e $local_repo_dir ) {
# Found local repository. Update it.
print("Found $local_repo_dir, skipped.\n"),next if $self->{skip_exists};
Expand Down

0 comments on commit a61279d

Please sign in to comment.