mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 13:17:32 +00:00
fix: exec
This commit is contained in:
parent
4ce9b01a1e
commit
f698a6ebc3
1 changed files with 7 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import _ from 'lodash';
|
||||
import { pluginName } from '../lib/path.js';
|
||||
import { mdLogLineToHTML } from '../utils/data.js';
|
||||
|
||||
import { exec } from 'child_process';
|
||||
let Update = null;
|
||||
try {
|
||||
Update = (await import('../../other/update.js').catch(e => null))?.update;
|
||||
|
|
@ -29,7 +29,11 @@ if (Update) {
|
|||
ZZZUpdate = class ZZZUpdate extends Update {
|
||||
exec(cmd, plugin, opts = {}) {
|
||||
if (plugin) opts.cwd = `plugins/${plugin}`;
|
||||
return Bot.exec(cmd, opts);
|
||||
return new Promise(resolve => {
|
||||
exec(cmd, { windowsHide: true }, (error, stdout, stderr) => {
|
||||
resolve({ error, stdout, stderr });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async handleLog(remote = false) {
|
||||
|
|
@ -51,6 +55,7 @@ if (Update) {
|
|||
const log = [];
|
||||
let current = true;
|
||||
for (let str of logAll) {
|
||||
if (!str) continue;
|
||||
str = str.split('||');
|
||||
if (str[0] === this.oldCommitId) break;
|
||||
if (str[2].includes('Merge')) continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue