Changing the search for home because strawberry perl is broken.

This commit is contained in:
Sergiotarxz 2024-03-04 03:25:53 +01:00
parent 44134761ea
commit 185fe331a6
2 changed files with 13 additions and 4 deletions

View File

@ -14,7 +14,6 @@ my $build = Module::Build->new(
'Path::Tiny' => 0,
'DBD::SQLite' => 0,
'DBI' => 0,
'File::HomeDir' => 0,
'Moo' => 0,
'namespace::clean' => 0,
'UUID::URandom' => 0,

View File

@ -6,21 +6,31 @@ use strict;
use warnings;
use Moo;
use File::HomeDir;
use Path::Tiny;
my $dist = 'GEmeTool';
sub config_dir {
my $class = shift;
my $config_dir = path(File::HomeDir->my_home)->child('.gemetool/config');
my $config_dir = path($class->find_home)->child('.gemetool/config');
$config_dir->mkpath;
return $config_dir;
}
sub data_dir {
my $class = shift;
my $data_dir = path(File::HomeDir->my_home)->child('.gemetool/data');
my $data_dir = path($class->find_home)->child('.gemetool/data');
$data_dir->mkpath;
return $data_dir;
}
sub find_home {
if (defined $ENV{HOME}) {
return $ENV{HOME};
}
if (defined $ENV{USERPROFILE}) {
return $ENV{USERPROFILE};
}
return path('.')->absolute;
}
1;