[interchange] Automatically create the $Vend::Cfg hash when Vend::External loaded
Josh Lavin <[email protected]> Fri, 02 Sep 2016 15:59:22 +0000
| Newsgroups | gmane.comp.web.interchange.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit 8c942fb90a802e252fe29433e28f5b01c32ea859 Author: Josh Lavin <[email protected]> Date: Fri Sep 2 08:58:15 2016 -0700 Automatically create the $Vend::Cfg hash when Vend::External loaded This prevents the need to call `session()` from scripts, when testing your Interchange instance from the command line. lib/Vend/External.pm | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) --- diff --git a/lib/Vend/External.pm b/lib/Vend/External.pm index 1a1dd99..eaf1b84 100644 --- a/lib/Vend/External.pm +++ b/lib/Vend/External.pm @@ -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"; } }