]> Dogcows Code - chaz/p5-Dist-Zilla-PluginBundle-Author-CCM/commitdiff
add DZIL_NO_UPLOAD to enable no_upload mode
authorCharles McGarvey <chazmcgarvey@brokenzipper.com>
Sat, 26 Nov 2016 02:36:14 +0000 (19:36 -0700)
committerCharles McGarvey <chazmcgarvey@brokenzipper.com>
Sat, 26 Nov 2016 05:10:38 +0000 (22:10 -0700)
lib/Dist/Zilla/PluginBundle/Author/CCM.pm

index 7381c41c01c89818c81c03f5cd9be6a3dbbdea18..3cdcea1d5e751a36035f4cc18b07acbcf37dee91 100644 (file)
@@ -157,7 +157,7 @@ has airplane => (
 
 =attr no_upload
 
 
 =attr no_upload
 
-Do not upload to CPAN.
+Do not upload to CPAN or git push.
 
 =cut
 
 
 =cut
 
@@ -165,7 +165,7 @@ has no_upload => (
     is      => 'ro',
     isa     => 'Bool',
     lazy    => 1,
     is      => 'ro',
     isa     => 'Bool',
     lazy    => 1,
-    default => 0,
+    default => sub { $ENV{DZIL_NO_UPLOAD} // shift->payload->{no_upload} // 0 },
 );
 
 =method configure
 );
 
 =method configure
@@ -177,6 +177,10 @@ Required by L<Dist::Zilla::Role::PluginBundle::Easy>.
 sub configure {
     my $self = shift;
 
 sub configure {
     my $self = shift;
 
+    if ($self->no_upload) {
+        print '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***', "\n";
+    }
+
     my @copy_from_build = qw(LICENSE);
     my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN);
     my @gather_exclude  = (@copy_from_build, qw(README.md));
     my @copy_from_build = qw(LICENSE);
     my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN);
     my @gather_exclude  = (@copy_from_build, qw(README.md));
@@ -255,7 +259,7 @@ sub configure {
         ['Git::Commit' => {allow_dirty => [@allow_dirty], commit_msg => 'Release %N %v%t%n%n%c'}],
         ['Git::CommitBuild' => {branch => '', release_branch => 'dist', release_message => 'Version %v%t'}],
         ['Git::Tag' => {tag_message => 'Version %v%t%n%n%c'}],
         ['Git::Commit' => {allow_dirty => [@allow_dirty], commit_msg => 'Release %N %v%t%n%n%c'}],
         ['Git::CommitBuild' => {branch => '', release_branch => 'dist', release_message => 'Version %v%t'}],
         ['Git::Tag' => {tag_message => 'Version %v%t%n%n%c'}],
-        ['Git::Push' => {push_to => 'origin master +master:refs/heads/release +dist', remotes_must_exist => 0}],
+        $self->no_upload ? () : ['Git::Push' => {push_to => 'origin master +master:refs/heads/release +dist', remotes_must_exist => 0}],
 
     );
 
 
     );
 
This page took 0.021585 seconds and 4 git commands to generate.