fixing typo and moving grab file into else clause
authorRogan Hamby <rhamby@esilibrary.com>
Mon, 12 Feb 2018 19:16:37 +0000 (14:16 -0500)
committerRogan Hamby <rhamby@esilibrary.com>
Mon, 12 Feb 2018 19:16:37 +0000 (14:16 -0500)
text/csv2sql

index 39ce2d2..37a136d 100755 (executable)
@@ -15,11 +15,11 @@ my $csv_config;
 
 sub init {
        our %config;
-       do '/openils/conf/offline-config.pl';
     if ($PGHOST and $PGPORT and $PGUSER and $PGDATABASE) 
     {
-        $db = connect_db($PGDATABASE,$PGUSER,undef,$PGHOST) or die $DBI::errstr;
+        $dbh = connect_db($PGDATABASE,$PGUSER,undef,$PGHOST) or die $DBI::errstr;
     } else {
+        do '/openils/conf/offline-config.pl';
         $dbh = DBI->connect( $config{dsn}, $config{usr}, $config{pw} ) or die $DBI::errstr;
     }