添加依赖管理

This commit is contained in:
whyour
2021-10-23 18:23:32 +08:00
parent bad247c51c
commit 795d1b938d
19 changed files with 1170 additions and 17 deletions
+16 -3
View File
@@ -433,16 +433,29 @@ export default class UserService {
public async updateSystem() {
const cp = spawn('ql -l update', { shell: '/bin/bash' });
this.sockService.sendMessage({
type: 'updateSystemVersion',
message: `开始更新系统`,
});
cp.stdout.on('data', (data) => {
this.sockService.sendMessage(data.toString());
this.sockService.sendMessage({
type: 'updateSystemVersion',
message: data.toString(),
});
});
cp.stderr.on('data', (data) => {
this.sockService.sendMessage(data.toString());
this.sockService.sendMessage({
type: 'updateSystemVersion',
message: data.toString(),
});
});
cp.on('error', (err) => {
this.sockService.sendMessage(JSON.stringify(err));
this.sockService.sendMessage({
type: 'updateSystemVersion',
message: JSON.stringify(err),
});
});
return { code: 200 };