use MOJO_CONFIG variable in Mounter.pm

This commit is contained in:
s7b4 2017-11-11 23:06:08 +01:00 committed by Luc Didry
parent 7efebff4bf
commit b3c6a28c73
1 changed files with 8 additions and 1 deletions

View File

@ -9,9 +9,16 @@ sub startup {
push @{$self->commands->namespaces}, 'Lufi::Command';
my $cfile = Mojo::File->new($Bin, '..' , 'lufi.conf');
if (defined $ENV{MOJO_CONFIG}) {
$cfile = Mojo::File->new($ENV{MOJO_CONFIG});
unless (-e $cfile->to_abs) {
$cfile = Mojo::File->new($Bin, '..', $ENV{MOJO_CONFIG});
}
}
my $config = $self->plugin('Config' =>
{
file => File::Spec->catfile($Bin, '..' ,'lufi.conf'),
file => $cfile,
default => {
prefix => '/',
theme => 'default',