Skip to content

Commit

Permalink
reports: fix detecting node modules
Browse files Browse the repository at this point in the history
  • Loading branch information
sni committed May 30, 2023
1 parent fa96085 commit 477b9ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/Thruk/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3837,12 +3837,12 @@ sub has_node_module {
return unless Thruk::Base::has_binary("node");
return unless Thruk::Base::has_binary("npm");

my($out, $rc) = Thruk::Utils::IO::cmd($c, ["npm", "ls", "-g"]);
my($rc, $out) = Thruk::Utils::IO::cmd($c, ["npm", "ls", "-g"]);
if($out =~ m/$module_name/mx) {
return 1;
}

($out, $rc) = Thruk::Utils::IO::cmd($c, ["npm", "ls"]);
($rc, $out) = Thruk::Utils::IO::cmd($c, ["npm", "ls"]);
if($out =~ m/$module_name/mx) {
return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ sub index {
}
}

if(!$ENV{'OMD_ROOT'} && !-d $c->config->{'var_path'}."/puppeteer" && !Thruk::Utils::has_node_module($c, 'puppeteer-core')) {
if(!$ENV{'OMD_ROOT'} && !-d $c->config->{'var_path'}."/puppeteer" && !Thruk::Utils::has_node_module($c, 'puppeteer')) {
$c->stash->{'puppeteer'} = 0;
}

Expand Down

0 comments on commit 477b9ae

Please sign in to comment.