Skip to content

Commit

Permalink
Make the data directory, even on AUTOMATED TESTING environments
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Feb 6, 2024
1 parent 1c29648 commit 92dc3e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
11 changes: 11 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ use strict;
use warnings;
use ExtUtils::MakeMaker 6.64; # 6.64 for TEST_REQUIRES

my @dirs = (
'lib/Genealogy/ObituaryDailyTimes/data'
);

foreach my $dir(@dirs) {
if(! -d $dir) {
print "Creating the download directory $dir\n";
mkdir $dir, 0755 || die "$dir: $@";
}
}

my $prereqs = {
'autodie' => 0,
'Carp' => 0,
Expand Down
9 changes: 4 additions & 5 deletions bin/create_db.PL
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,16 @@ my %normalised;
my $force_flag;
my $dir = 'lib/Genealogy/ObituaryDailyTimes/data';

if(!-d $dir) {
# Make the data directory, even on AUTOMATED TESTING environments
mkdir $dir, 0755;
}

if(defined($ARGV[0]) && ($ARGV[0] eq '-f')) {
$force_flag++;
} elsif($ENV{'AUTOMATED_TESTING'}) {
exit;
}

if(!-d $dir) {
mkdir $dir, 0755;
}

my $filename = File::Spec->catdir($dir, 'obituaries.sql');

if(-r $filename) {
Expand Down

0 comments on commit 92dc3e9

Please sign in to comment.