move map -> grep, little bit better on the eyes
This commit is contained in:
parent
b4743f94c2
commit
afef60893e
|
@ -67,7 +67,8 @@ END_USAGE
|
|||
my ($bridgename) = @ARGV;
|
||||
if (!$bridgename) { _return_error_with($USAGE); }
|
||||
|
||||
my @config_files = map { -e $_ ? $_ : () } ('./hue.conf', './.hue.conf', '/etc/hue.conf', "$ENV{'HOME'}/.hue.conf", "$ENV{'HOME'}/hue.conf");
|
||||
#my @config_files = map { -e $_ ? $_ : () } ('./hue.conf', './.hue.conf', '/etc/hue.conf', "$ENV{'HOME'}/.hue.conf", "$ENV{'HOME'}/hue.conf");
|
||||
my @config_files = grep { -e } ('./hue.conf', './.hue.conf', '/etc/hue.conf', "$ENV{'HOME'}/.hue.conf", "$ENV{'HOME'}/hue.conf");
|
||||
my $config = Config::Tiny->read($config_files[-1], 'utf8');
|
||||
my $bridge = $config->{$bridgename}{ip} || _return_error_with("$USAGE\nError: bridge-name '$bridgename' not found.\n");
|
||||
my $token = $config->{$bridgename}{token};
|
||||
|
|
Loading…
Reference in New Issue