RunCommand: enable the plugin if dynamicruncommand is set

This commit is contained in:
Graham Christensen
2021-12-08 11:38:14 -05:00
parent 6ffc93c01a
commit ea311a0eb4
2 changed files with 140 additions and 3 deletions

View File

@ -12,7 +12,29 @@ use Try::Tiny;
sub isEnabled {
my ($self) = @_;
return defined $self->{config}->{runcommand};
return areStaticCommandsEnabled($self->{config}) || areDynamicCommandsEnabled($self->{config});
}
sub areStaticCommandsEnabled {
my ($config) = @_;
if (defined $config->{runcommand}) {
return 1;
}
return 0;
}
sub areDynamicCommandsEnabled {
my ($config) = @_;
if ((defined $config->{dynamicruncommand})
&& $config->{dynamicruncommand}->{enable}) {
return 1;
}
return 0;
}
sub configSectionMatches {