Skip to content

Commit b9059c2

Browse files
committed
Don't refuse to delete mappings in test environment
1 parent d076832 commit b9059c2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/MetaCPAN/Script/Mapping.pm

+4-4
Original file line numberDiff line numberDiff line change
@@ -243,16 +243,16 @@ sub delete_index {
243243
sub delete_all {
244244
my $self = $_[0];
245245
my $runtime_environment = 'production';
246-
my $is_development = 0;
247246

248247
$runtime_environment = $ENV{'PLACK_ENV'}
249248
if ( defined $ENV{'PLACK_ENV'} );
250249
$runtime_environment = $ENV{'MOJO_MODE'}
251250
if ( defined $ENV{'MOJO_MODE'} );
252251

253-
$is_development = 1
254-
if ( $runtime_environment eq 'development'
255-
|| $runtime_environment eq 'testing' );
252+
my $is_development
253+
= $ENV{HARNESS_ACTIVE}
254+
|| $runtime_environment eq 'development'
255+
|| $runtime_environment eq 'testing';
256256

257257
if ($is_development) {
258258
my $name = undef;

0 commit comments

Comments
 (0)