@brimveyn/aimux 1.22.0 → 1.22.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -13,12 +13,25 @@ export async function runCli(
|
|
|
13
13
|
timeoutMs: number = DEFAULT_TIMEOUT_MS,
|
|
14
14
|
cwd?: string
|
|
15
15
|
): Promise<CliResult> {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
let proc: Bun.Subprocess<'ignore', 'pipe', 'pipe'>
|
|
17
|
+
try {
|
|
18
|
+
proc = Bun.spawn([command, ...args], {
|
|
19
|
+
cwd,
|
|
20
|
+
stderr: 'pipe',
|
|
21
|
+
stdin: 'ignore',
|
|
22
|
+
stdout: 'pipe',
|
|
23
|
+
})
|
|
24
|
+
} catch (error) {
|
|
25
|
+
// posix_spawn throws — synchronously — for a missing binary AND for a cwd
|
|
26
|
+
// that no longer exists (a deleted project dir or a pruned worktree), and
|
|
27
|
+
// it names the binary in both. Uncaught, that took the whole app down.
|
|
28
|
+
return {
|
|
29
|
+
error: `${command}: ${String(error)}`.slice(0, 200),
|
|
30
|
+
ok: false,
|
|
31
|
+
stderr: '',
|
|
32
|
+
stdout: '',
|
|
33
|
+
}
|
|
34
|
+
}
|
|
22
35
|
|
|
23
36
|
const timeout = setTimeout(() => {
|
|
24
37
|
try {
|