Changing the search for home because strawberry perl is broken.
This commit is contained in:
parent
44134761ea
commit
185fe331a6
1
Build.PL
1
Build.PL
|
@ -14,7 +14,6 @@ my $build = Module::Build->new(
|
||||||
'Path::Tiny' => 0,
|
'Path::Tiny' => 0,
|
||||||
'DBD::SQLite' => 0,
|
'DBD::SQLite' => 0,
|
||||||
'DBI' => 0,
|
'DBI' => 0,
|
||||||
'File::HomeDir' => 0,
|
|
||||||
'Moo' => 0,
|
'Moo' => 0,
|
||||||
'namespace::clean' => 0,
|
'namespace::clean' => 0,
|
||||||
'UUID::URandom' => 0,
|
'UUID::URandom' => 0,
|
||||||
|
|
|
@ -6,21 +6,31 @@ use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
use Moo;
|
use Moo;
|
||||||
use File::HomeDir;
|
|
||||||
use Path::Tiny;
|
use Path::Tiny;
|
||||||
|
|
||||||
my $dist = 'GEmeTool';
|
my $dist = 'GEmeTool';
|
||||||
|
|
||||||
sub config_dir {
|
sub config_dir {
|
||||||
my $class = shift;
|
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;
|
$config_dir->mkpath;
|
||||||
return $config_dir;
|
return $config_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub data_dir {
|
sub data_dir {
|
||||||
my $class = shift;
|
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;
|
$data_dir->mkpath;
|
||||||
return $data_dir;
|
return $data_dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub find_home {
|
||||||
|
if (defined $ENV{HOME}) {
|
||||||
|
return $ENV{HOME};
|
||||||
|
}
|
||||||
|
if (defined $ENV{USERPROFILE}) {
|
||||||
|
return $ENV{USERPROFILE};
|
||||||
|
}
|
||||||
|
return path('.')->absolute;
|
||||||
|
}
|
||||||
1;
|
1;
|
||||||
|
|
Loading…
Reference in New Issue