mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 21:40:51 +02:00
Fix
This commit is contained in:
@@ -33,8 +33,11 @@ module.exports = class ExecCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exec(command) {
|
exec(command) {
|
||||||
const { stdout, stderr } = execSync(command);
|
try {
|
||||||
if (stderr) return { err: true, std: stderr.trim() };
|
const stdout = execSync(command, { timeout: 30000 });
|
||||||
return { err: false, std: stdout.trim() };
|
return { err: false, std: stdout.trim() };
|
||||||
|
} catch (err) {
|
||||||
|
return { err: true, std: err.stderr.trim() };
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user