mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 21:40:49 +02:00
Fix
This commit is contained in:
@@ -36,13 +36,14 @@ module.exports = class ExecCommand extends Command {
|
|||||||
|
|
||||||
async exec(command) {
|
async exec(command) {
|
||||||
let hrDiff;
|
let hrDiff;
|
||||||
|
const hrStart = process.hrtime();
|
||||||
try {
|
try {
|
||||||
const hrStart = process.hrtime();
|
|
||||||
const { stdout } = await execAsync(command, { timeout: 30000, encoding: 'utf8' });
|
const { stdout } = await execAsync(command, { timeout: 30000, encoding: 'utf8' });
|
||||||
hrDiff = process.hrtime(hrStart);
|
hrDiff = process.hrtime(hrStart);
|
||||||
return { err: false, std: stdout.trim(), hrDiff };
|
return { err: false, std: stdout.trim(), hrDiff };
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
return { err: true, std: err.stderr.trim(), hrDiff: null };
|
hrDiff = process.hrtime(hrStart);
|
||||||
|
return { err: true, std: err.stderr.trim(), hrDiff };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user