diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 608d9e4b6..0bbaa28a2 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -9,6 +9,7 @@ - fixed #11861: addAttachment method removed from WebGUI 7 thus breaking the API - fixed #11868: WebGUI::Session::Form::validToken throws unnecessary warnings - fixed #11875: Error loading empty module + - fixed #11873: findBrokenAssets.pl doesn't support custom assets 7.10.0 - fixed #11812: Checking www_ajaxSave's response in the cart js, urlencoding post parameters diff --git a/sbin/findBrokenAssets.pl b/sbin/findBrokenAssets.pl index 76a90a3e2..c7ed20249 100644 --- a/sbin/findBrokenAssets.pl +++ b/sbin/findBrokenAssets.pl @@ -41,6 +41,14 @@ pod2usage( verbose => 1 ) if $help; pod2usage( verbose => 2 ) if $man; pod2usage( msg => "Must specify a config file!" ) unless $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; +} + my $session = start( $webguiRoot, $configFile ); sub progress { @@ -189,6 +197,24 @@ print "\n"; #---------------------------------------------------------------------------- # Your sub here +#------------------------------------------------- +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; +} + + #---------------------------------------------------------------------------- sub start { my $webguiRoot = shift;