From: Florian Forster Date: Mon, 11 Sep 2006 21:16:40 +0000 (+0200) Subject: LiCoM::Config: Read the file `licom.conf' in the script's directory too, if it exists. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c603325170ce0a8cb8a203aa7aacc74b6587366e;p=licom.git LiCoM::Config: Read the file `licom.conf' in the script's directory too, if it exists. --- diff --git a/lib/LiCoM/Config.pm b/lib/LiCoM/Config.pm index 295f7eb..be8359f 100644 --- a/lib/LiCoM/Config.pm +++ b/lib/LiCoM/Config.pm @@ -4,6 +4,8 @@ use strict; use warnings; use Carp (qw(cluck confess)); +use File::Basename (qw(dirname)); + use Exporter; @LiCoM::Config::EXPORT_OK = (qw(get_config set_config read_config)); @@ -72,6 +74,10 @@ sub read_config { push (@files, $ENV{'HOME'} . '/.licomrc'); } + elsif (defined ($ENV{'SCRIPT_FILENAME'})) + { + push (@files, dirname ($ENV{'SCRIPT_FILENAME'}) . '/licom.conf'); + } for (@files) {