mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix
This commit is contained in:
@@ -36,13 +36,14 @@ module.exports = class ExecCommand extends Command {
|
||||
|
||||
async exec(command) {
|
||||
let hrDiff;
|
||||
const hrStart = process.hrtime();
|
||||
try {
|
||||
const hrStart = process.hrtime();
|
||||
const { stdout } = await execAsync(command, { timeout: 30000, encoding: 'utf8' });
|
||||
hrDiff = process.hrtime(hrStart);
|
||||
return { err: false, std: stdout.trim(), hrDiff };
|
||||
} 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