feat: implement runCommand wrapper and refactor command executions across modules

This commit is contained in:
Lauren ten Hoor
2026-02-13 10:50:35 +08:00
parent e55b7fa555
commit 83f1f1adf0
24 changed files with 209 additions and 178 deletions

View File

@@ -3,12 +3,9 @@
*
* Replaces 7 if-blocks with a data-driven lookup table.
*/
import { execFile } from "node:child_process";
import { promisify } from "node:util";
import type { StateLabel, IssueProvider } from "../providers/provider.js";
import { deactivateWorker } from "../projects.js";
const execFileAsync = promisify(execFile);
import { runCommand } from "../run-command.js";
export type CompletionRule = {
from: StateLabel;
@@ -84,7 +81,7 @@ export async function executeCompletion(opts: {
// Git pull (dev:done)
if (rule.gitPull) {
try {
await execFileAsync("git", ["pull"], { cwd: repoPath, timeout: 30_000 });
await runCommand(["git", "pull"], { timeoutMs: 30_000, cwd: repoPath });
} catch { /* best-effort */ }
}