(cmd: string)
| 18 | const prefixes = getPrefixes(); |
| 19 | const mainPrefix = prefixes[0] || "."; |
| 20 | // 命令执行统一封装 |
| 21 | class SystemExecutor { |
| 22 | static async run(cmd: string): Promise<{ success: boolean; output: string; error?: string }> { |
| 23 | try { |
| 24 | const { stdout, stderr } = await execAsync(cmd); |
| 25 | return { success: true, output: String(stdout ?? "").trim(), error: String(stderr ?? "").trim() }; |
| 26 | } catch (e: any) { |
| 27 | return { |
| 28 | success: false, |
| 29 | output: String(e?.stdout ?? "").trim(), |
| 30 | error: String(e?.stderr ?? e?.message ?? e ?? "").trim(), |
| 31 | }; |
| 32 | } |
| 33 | } |
| 34 |
no outgoing calls
no test coverage detected