Skip to content

Commit

Permalink
Use CACHE_DIR instead of CACHEDIR
Browse files Browse the repository at this point in the history
  • Loading branch information
nigelhorne committed Mar 26, 2024
1 parent ff81237 commit cf16e85
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions bin/address_lookup
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@ if(scalar(@ARGV) == 0) {
die "Usage: $0 location";
}

my $cachedir;
if(my $e = $ENV{'CACHEDIR'}) {
$cachedir = File::Spec->catfile($e, basename($0));
my $cache_dir;
if(my $e = $ENV{'CACHE_DIR'}) {
$cache_dir = File::Spec->catfile($e, basename($0));
} else {
$cachedir = File::Spec->catfile(File::Spec->tmpdir(), 'cache', basename($0));
# $cache_dir = File::Spec->catfile(File::Spec->tmpdir(), 'cache', basename($0));
$cache_dir = File::Spec->catfile(File::HomeDir->my_home(), '.cache', basename($0))
}
my $geocoder = Geo::Coder::List->new(cache => CHI->new(driver => 'File', root_dir => $cachedir));
my $geocoder = Geo::Coder::List->new(cache => CHI->new(driver => 'File', root_dir => $cache_dir));
my $freegeocoder;
if(my $oa = $ENV{'OPENADDR_HOME'}) {
$freegeocoder = Geo::Coder::Free->new(openaddr => $oa);
Expand Down

0 comments on commit cf16e85

Please sign in to comment.