Skip to content

Commit 31eaecc

Browse files
committed
optimize code
1 parent b096501 commit 31eaecc

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/DependenceManager.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,10 @@ export class DependenceManager implements ManagerInterface {
8989
}
9090
// try install dependences
9191
for (const fullname of depList) {
92-
if (!fullname.startsWith('Device.'))
92+
if (!fullname.startsWith('Device.')) {
93+
GlobalEvent.emit('globalLog.append', `[Warn] ${' '.repeat(pendingList.length)}Skip component: '${fullname}'\n`);
9394
continue; /* 排除非 Device 类型的组件 */
95+
}
9496
const reqName = fullname.replace('Device.', '');
9597
const compList = packageManager.FindAllComponents(reqName);
9698
if (compList) {
@@ -104,10 +106,6 @@ export class DependenceManager implements ManagerInterface {
104106
this._installComponent(packName, item, pendingList);
105107
pendingList.pop();
106108
}
107-
} else {
108-
//throw new Error(`Not found required sub component: '${comp}'`);
109-
GlobalEvent.emit('globalLog.append',
110-
`[Warn] ${' '.repeat(pendingList.length)}Not found required sub component: '${reqName}'\n`);
111109
}
112110
}
113111
}

0 commit comments

Comments
 (0)