mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修复安装依赖逻辑
This commit is contained in:
parent
a9e0a934a7
commit
e4f7461b62
|
@ -21,7 +21,7 @@ export default async () => {
|
|||
);
|
||||
|
||||
// 初始化时安装所有处于安装中,安装成功,安装失败的依赖
|
||||
DependenceModel.findAll({ where: {} }).then(async (docs) => {
|
||||
DependenceModel.findAll({ where: {}, raw: true }).then(async (docs) => {
|
||||
const groups = _.groupBy(docs, 'type');
|
||||
for (const key in groups) {
|
||||
if (Object.prototype.hasOwnProperty.call(groups, key)) {
|
||||
|
|
|
@ -105,7 +105,7 @@ export default class DependenceService {
|
|||
);
|
||||
|
||||
const docs = await DependenceModel.findAll({ where: { id: ids } });
|
||||
await this.installOrUninstallDependencies(docs);
|
||||
this.installOrUninstallDependencies(docs);
|
||||
return docs;
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,6 @@ export default class DependenceService {
|
|||
)[dependencies[0].type as any];
|
||||
const actionText = isInstall ? '安装' : '删除';
|
||||
const depIds = dependencies.map((x) => x.id) as number[];
|
||||
const cp = spawn(`${depRunCommand} ${depNames}`, { shell: '/bin/bash' });
|
||||
const startTime = Date.now();
|
||||
this.sockService.sendMessage({
|
||||
type: socketMessageType,
|
||||
|
@ -161,6 +160,9 @@ export default class DependenceService {
|
|||
startTime,
|
||||
).toLocaleString()}\n\n`,
|
||||
);
|
||||
|
||||
const cp = spawn(`${depRunCommand} ${depNames}`, { shell: '/bin/bash' });
|
||||
|
||||
cp.stdout.on('data', async (data) => {
|
||||
this.sockService.sendMessage({
|
||||
type: socketMessageType,
|
||||
|
|
Loading…
Reference in New Issue
Block a user