make installClass read lines from preload.custom for additional directories. Fixes bug #12189
This commit is contained in:
parent
9113408408
commit
9985d24ea2
2 changed files with 28 additions and 0 deletions
|
|
@ -58,6 +58,15 @@ if( ! -e $configFile ) {
|
|||
|
||||
die "Config file '$configFile' does not exist!\n" if ! -e $configFile;
|
||||
|
||||
foreach my $libDir ( readLines( "preload.custom" ) ) {
|
||||
if ( !-d $libDir ) {
|
||||
warn "WARNING: Not adding lib directory '$libDir' from preload.custom: Directory does not exist.\n";
|
||||
next;
|
||||
}
|
||||
unshift @INC, $libDir;
|
||||
}
|
||||
|
||||
|
||||
# Open the session
|
||||
my $session = WebGUI::Session->open( $webguiRoot, $configFile );
|
||||
$session->user( { userId => 3 } );
|
||||
|
|
@ -98,6 +107,24 @@ else {
|
|||
$session->var->end;
|
||||
$session->close;
|
||||
|
||||
#-------------------------------------------------
|
||||
sub readLines {
|
||||
my $file = shift;
|
||||
my @lines;
|
||||
if (open(my $fh, '<', $file)) {
|
||||
while (my $line = <$fh>) {
|
||||
$line =~ s/#.*//;
|
||||
$line =~ s/^\s+//;
|
||||
$line =~ s/\s+$//;
|
||||
next if !$line;
|
||||
push @lines, $line;
|
||||
}
|
||||
close $fh;
|
||||
}
|
||||
return @lines;
|
||||
}
|
||||
|
||||
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue