refactor:获取依赖失败不抛出异常

This commit is contained in:
妙码生花 2023-03-02 09:13:07 +08:00
parent 5fe08e0988
commit e520b3a606

View File

@ -75,7 +75,12 @@ class Depends
*/
public function getDepends(bool $devEnv = false)
{
$content = $this->getContent();
try {
$content = $this->getContent();
} catch (Exception $e) {
return [];
}
if ($this->type == 'npm') {
return $devEnv ? $content['devDependencies'] : $content['dependencies'];
} else {