Skip to content

Commit

Permalink
Make sure indirect updates work (#246)
Browse files Browse the repository at this point in the history
* Make sure indirect updates work

* Update CosyComposer.php
  • Loading branch information
eiriksm committed May 26, 2022
1 parent 29dde6b commit 6b3f1f0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/CosyComposer.php
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,18 @@ public function run()
'version' => $item->latest,
];
$security_update = false;
$package_name_in_composer_json = self::getComposerJsonName($composer_json_data, $item->name, $this->compserJsonDir);
$package_name_in_composer_json = $item->name;
try {
$package_name_in_composer_json = self::getComposerJsonName($composer_json_data, $item->name, $this->compserJsonDir);
} catch (\Exception $e) {
// If this was a package that we somehow got because we have allowed to update other than direct
// dependencies we can avoid re-throwing this.
if ($config->shouldCheckDirectOnly()) {
throw $e;
}
// Taking a risk :o.
$package_name_in_composer_json = $item->name;
}
if (isset($security_alerts[$package_name_in_composer_json])) {
$security_update = true;
}
Expand Down

0 comments on commit 6b3f1f0

Please sign in to comment.