From: Marius Gavrilescu Date: Thu, 15 May 2014 13:01:28 +0000 (+0300) Subject: Make tools connect to $ENV{GRUNTMASTER_DSN} if it exists X-Git-Tag: 5999.000_003~8 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=30e287c3bec805e7d17eadc3cadf140f1da35a9c;p=gruntmaster-data.git Make tools connect to $ENV{GRUNTMASTER_DSN} if it exists --- diff --git a/gruntmaster-contest b/gruntmaster-contest index ff121cd..856faae 100755 --- a/gruntmaster-contest +++ b/gruntmaster-contest @@ -9,7 +9,8 @@ use Date::Parse qw/str2time/; ################################################## -my $db = Gruntmaster::Data->connect('dbi:Pg:'); +my $dsn = $ENV{GRUNTMASTER_DSN} // 'dbi:Pg:'; +my $db = Gruntmaster::Data->connect($dsn); sub cmd_help{ exec perldoc => $0 diff --git a/gruntmaster-job b/gruntmaster-job index 126e1d0..06e3fe1 100755 --- a/gruntmaster-job +++ b/gruntmaster-job @@ -8,7 +8,8 @@ use POSIX qw/strftime/; ################################################## -my $db = Gruntmaster::Data->connect('dbi:Pg:'); +my $dsn = $ENV{GRUNTMASTER_DSN} // 'dbi:Pg:'; +my $db = Gruntmaster::Data->connect($dsn); sub cmd_help{ exec perldoc => $0 diff --git a/gruntmaster-problem b/gruntmaster-problem index afcb1be..b942897 100755 --- a/gruntmaster-problem +++ b/gruntmaster-problem @@ -11,7 +11,8 @@ use Getopt::Long qw/:config require_order/; ################################################## -my $db = Gruntmaster::Data->connect('dbi:Pg:'); +my $dsn = $ENV{GRUNTMASTER_DSN} // 'dbi:Pg:'; +my $db = Gruntmaster::Data->connect($dsn); sub cmd_help{ exec perldoc => $0