Take a --configFile of either absolute path or relative to etc. Maybe.
This commit is contained in:
parent
9b0dcf2b68
commit
922e4cef37
1 changed files with 12 additions and 8 deletions
|
|
@ -15,17 +15,17 @@ use strict;
|
|||
use File::Basename ();
|
||||
use File::Spec;
|
||||
|
||||
use Getopt::Long;
|
||||
use Pod::Usage;
|
||||
use WebGUI::Pluggable;
|
||||
use WebGUI::Session;
|
||||
|
||||
my $webguiRoot;
|
||||
BEGIN {
|
||||
$webguiRoot = File::Spec->rel2abs(File::Spec->catdir(File::Basename::dirname(__FILE__), File::Spec->updir));
|
||||
unshift @INC, File::Spec->catdir($webguiRoot, 'lib');
|
||||
}
|
||||
|
||||
use Getopt::Long;
|
||||
use Pod::Usage;
|
||||
use WebGUI::Pluggable;
|
||||
use WebGUI::Session;
|
||||
|
||||
$|++;
|
||||
|
||||
# Get options
|
||||
|
|
@ -51,11 +51,15 @@ pod2usage( -verbose => 2 )
|
|||
pod2usage("$0: Must specify a configFile")
|
||||
if !$configFile;
|
||||
|
||||
die "Config file '$configFile' does not exist!\n"
|
||||
if !-f '../etc/' . $configFile;
|
||||
if( ! -e $configFile ) {
|
||||
my $possible_configFile = File::Spec->catfile($webguiRoot, 'etc', $configFile);
|
||||
$configFile = $possible_configFile if -e $possible_configFile;
|
||||
}
|
||||
|
||||
die "Config file '$configFile' does not exist!\n" if ! -e $configFile;
|
||||
|
||||
# Open the session
|
||||
my $session = WebGUI::Session->open( "..", $configFile );
|
||||
my $session = WebGUI::Session->open( $webguiRoot, $configFile );
|
||||
$session->user( { userId => 3 } );
|
||||
|
||||
# Install or uninstall the asset
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue