From 55dc434608ebfa4cef54f75ea8f0f5244320e3dd Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Sat, 27 Apr 2024 15:57:00 +0100 Subject: [PATCH] Don't refuse to delete mappings in test environment --- lib/MetaCPAN/Script/Mapping.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/MetaCPAN/Script/Mapping.pm b/lib/MetaCPAN/Script/Mapping.pm index 9780f52df..37e40b1bc 100644 --- a/lib/MetaCPAN/Script/Mapping.pm +++ b/lib/MetaCPAN/Script/Mapping.pm @@ -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;