From 89436259c8641f7286f0d50171ffb0011944b696 Mon Sep 17 00:00:00 2001 From: Gianni Ceccarelli Date: Sat, 18 Oct 2014 11:33:58 +0000 Subject: config file --- driver-async.pl | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/driver-async.pl b/driver-async.pl index 19b6c21..a996aaf 100644 --- a/driver-async.pl +++ b/driver-async.pl @@ -4,14 +4,19 @@ use warnings; use 5.014; use HomePanel::Driver; use Path::Tiny; +use Config::Any; -my $template = -my $key=$ARGV[0]; +my $cfg_set = Config::Any->load_files({ + files => \@ARGV, + use_ext => 1, +}); + +my %config = map { %$_ } @$cfg_set; my $hp = HomePanel::Driver->new({ - template_file => path(__FILE__)->parent->child('forecast.html.tt'), - output_file => path(__FILE__)->parent->child('panel.html'), - forecast_key => $ARGV[0], + 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}, }); $hp->start; -- cgit v1.2.3