From cd225e8d3f9efec01e9cadcf8934865e5add39dd Mon Sep 17 00:00:00 2001 From: Olivier Seret Date: Tue, 17 Mar 2020 12:53:47 +0000 Subject: [PATCH] Use environment variables for config path --- lib/Pathogens/ConfigSettings.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Pathogens/ConfigSettings.pm b/lib/Pathogens/ConfigSettings.pm index e45ce74..6c55b03 100644 --- a/lib/Pathogens/ConfigSettings.pm +++ b/lib/Pathogens/ConfigSettings.pm @@ -20,7 +20,9 @@ has 'settings' => ( is => 'rw', isa => 'HashRef', lazy_build => 1 ); sub _build_settings { my $self = shift; - my %config_settings = %{ Load( scalar read_file("config/".$self->environment."/".$self->filename.""))}; + my $directory = (defined $ENV{'UPDATE_PIPELINE_CONFIG_PATH'}) ? $ENV{'UPDATE_PIPELINE_CONFIG_PATH'} : "config/" . $self->environment ; + + my %config_settings = %{ Load( scalar read_file($directory . "/" . $self->filename.""))}; return \%config_settings; }