diff options
author | Jesse Luehrs <doy@tozt.net> | 2011-02-16 11:07:35 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2011-02-16 11:07:35 -0600 |
commit | be1e0792273b71a922fd5231d2f5097b79cc1411 (patch) | |
tree | f91721e53bab856e479e86f61127352373ed7ad8 /lib | |
parent | b22ebeb1b7898900fad9b698b5c3ede906ede200 (diff) | |
download | dist-zilla-pluginbundle-doy-be1e0792273b71a922fd5231d2f5097b79cc1411.tar.gz dist-zilla-pluginbundle-doy-be1e0792273b71a922fd5231d2f5097b79cc1411.zip |
better Repository handling
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Dist/Zilla/PluginBundle/DOY.pm | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/Dist/Zilla/PluginBundle/DOY.pm b/lib/Dist/Zilla/PluginBundle/DOY.pm index 5b78142..b3afd03 100644 --- a/lib/Dist/Zilla/PluginBundle/DOY.pm +++ b/lib/Dist/Zilla/PluginBundle/DOY.pm @@ -2,6 +2,8 @@ package Dist::Zilla::PluginBundle::DOY; use Moose; # ABSTRACT: Dist::Zilla plugins for me +use List::MoreUtils qw(any); + use Dist::Zilla; with 'Dist::Zilla::Role::PluginBundle::Easy'; @@ -74,15 +76,17 @@ has is_test_dist => ( default => sub { shift->dist =~ /^Foo-/ ? 1 : 0 }, ); -has github_url => ( +has git_remote => ( is => 'ro', isa => 'Str', lazy => 1, default => sub { my $self = shift; - my $dist = $self->dist; - $dist = lc($dist); - "git://github.com/doy/$dist.git"; + return '' unless -d '.git'; + my @remotes = `git remote`; + chomp @remotes; + return 'github' if any { $_ eq 'github' } @remotes; + return 'origin'; }, ); @@ -140,8 +144,7 @@ has plugin_options => ( my %opts = ( 'NextRelease' => { format => '%-5v %{yyyy-MM-dd}d' }, 'Repository' => { - git_remote => $self->github_url, - github_http => 0 + git_remote => $self->git_remote, }, 'Git::Check' => { allow_dirty => '' }, 'Git::Tag' => { tag_format => '%v', tag_message => '' }, |