From c546aa25baf28aceeb0ce175c895910ec796bbe3 Mon Sep 17 00:00:00 2001 From: Gianni Ceccarelli Date: Sat, 18 Oct 2014 11:59:57 +0000 Subject: fix config loading --- driver-async.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) mode change 100644 => 100755 driver-async.pl diff --git a/driver-async.pl b/driver-async.pl old mode 100644 new mode 100755 index a996aaf..0d8e86a --- a/driver-async.pl +++ b/driver-async.pl @@ -2,6 +2,7 @@ use strict; use warnings; use 5.014; +use lib 'lib'; use HomePanel::Driver; use Path::Tiny; use Config::Any; @@ -11,11 +12,11 @@ my $cfg_set = Config::Any->load_files({ use_ext => 1, }); -my %config = map { %$_ } @$cfg_set; +my %config = map { %{(values %$_)[0]} } @$cfg_set; my $hp = HomePanel::Driver->new({ - template_file => $config{template} || path(__FILE__)->parent->child('forecast.html.tt'), - output_file => $config{output_file} || path(__FILE__)->parent->child('forecast.html'), + template_file => ($config{template} || path(__FILE__)->parent->child('forecast.html.tt')), + output_file => ($config{output_file} || path(__FILE__)->parent->child('forecast.html')), forecast_key => $config{forecast_key}, }); -- cgit v1.2.3