add site_local_files feature for easy lib/template override

This commit is contained in:
Oliver Gorwits
2017-05-14 21:12:19 +01:00
parent 824ec751e2
commit da04522199
4 changed files with 30 additions and 6 deletions

View File

@@ -3,9 +3,16 @@ package App::Netdisco::Configuration;
use App::Netdisco::Environment;
use Dancer ':script';
use Path::Class 'dir';
BEGIN {
# stuff useful locations into @INC
unshift @INC, @{ (setting('include_paths') || []) };
if (setting('include_paths') and ref [] eq ref setting('include_paths')) {
# stuff useful locations into @INC
push @{setting('include_paths')},
dir(($ENV{NETDISCO_HOME} || $ENV{HOME}), 'nd-site-local', 'lib')->stringify
if (setting('site_local_files'));
unshift @INC, @{setting('include_paths')};
}
}
# set up database schema config from simple config vars