Skip to content

Commit

Permalink
Automatically create the $Vend::Cfg hash when Vend::External loaded
Browse files Browse the repository at this point in the history
This prevents the need to call `session()` from scripts, when testing
your Interchange instance from the command line.
  • Loading branch information
Josh Lavin committed Sep 2, 2016
1 parent b0c0d89 commit 8c942fb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Vend/External.pm
Expand Up @@ -209,6 +209,11 @@ BEGIN {
or die "eval_file failed (value=$Vend::Global): $!";
#::logDebug("DID read global");
#logDebug(uneval($Vend::Global));

$Vend::Cat ||= $ENV{EXT_INTERCHANGE_CATALOG}
or die "No Interchange catalog specified\n";
$Vend::Cfg = $Vend::Global->{Catalogs}{$Vend::Cat}{external_config}
or die "Catalog $Vend::Cat not found.\n";
}
}

Expand Down

0 comments on commit 8c942fb

Please sign in to comment.