diff options
author | Gianni Ceccarelli <dakkar@thenautilus.net> | 2014-10-18 11:33:58 +0000 |
---|---|---|
committer | Gianni Ceccarelli <dakkar@thenautilus.net> | 2014-10-18 12:00:43 +0000 |
commit | 89436259c8641f7286f0d50171ffb0011944b696 (patch) | |
tree | 0de3464d9977eb8973a24285d98fb38401fab280 | |
parent | licence everything under AGPL-3 (diff) | |
download | HomePanel-89436259c8641f7286f0d50171ffb0011944b696.tar.gz HomePanel-89436259c8641f7286f0d50171ffb0011944b696.tar.bz2 HomePanel-89436259c8641f7286f0d50171ffb0011944b696.zip |
config file
-rw-r--r-- | driver-async.pl | 15 |
1 files 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; |