Commit d29dbad9 authored by Síle Ekaterin Liszka's avatar Síle Ekaterin Liszka
Browse files

Chessa::Bug: fix module loader

parent a6b2469e
......@@ -43,6 +43,7 @@ sub new {
);
$self->{finder} = $finder;
$self->{plugins} = [];
$self->{finder}->rescan;
my @plugins = $finder->modules;
......@@ -60,10 +61,6 @@ sub load_module {
my ($module, $conf) = @_;
my $loaded = undef;
unless (exists($self->{init})) {
$self->{finder}->rescan;
}
if (defined($conf) && ref($conf) eq 'HASH') {
$conf->{irc} = $self->{irc};
} else {
......@@ -72,6 +69,8 @@ sub load_module {
$self->{log}("Attempting to load $module plugin...");
$module =~ s/::(.*?)$/$1/;
try {
$loaded = $self->{finder}->construct($module, $self->{http}, $self->{log}, sub { $self->message(@_) }, $conf);
} catch {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment