mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-21 22:55:36 +00:00
refactor:获取依赖失败不抛出异常
This commit is contained in:
parent
5fe08e0988
commit
e520b3a606
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user