Skip to content

Commit

Permalink
Don't refuse to delete mappings in test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Apr 27, 2024
1 parent 6bf88ac commit 55dc434
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/MetaCPAN/Script/Mapping.pm
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,16 @@ sub delete_index {
sub delete_all {
my $self = $_[0];
my $runtime_environment = 'production';
my $is_development = 0;

$runtime_environment = $ENV{'PLACK_ENV'}
if ( defined $ENV{'PLACK_ENV'} );
$runtime_environment = $ENV{'MOJO_MODE'}
if ( defined $ENV{'MOJO_MODE'} );

$is_development = 1
if ( $runtime_environment eq 'development'
|| $runtime_environment eq 'testing' );
my $is_development
= $ENV{HARNESS_ACTIVE}
|| $runtime_environment eq 'development'
|| $runtime_environment eq 'testing';

if ($is_development) {
my $name = undef;
Expand Down

0 comments on commit 55dc434

Please sign in to comment.