From ca8537af0ab596fddd8d72e6630f278326ef5360 Mon Sep 17 00:00:00 2001 From: Leo Goetz Date: Sun, 24 May 2026 06:50:57 +0200 Subject: feat: added fix functionality --- src/utils/helper.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/utils/helper.ts (limited to 'src/utils') diff --git a/src/utils/helper.ts b/src/utils/helper.ts new file mode 100644 index 0000000..379aeef --- /dev/null +++ b/src/utils/helper.ts @@ -0,0 +1,15 @@ +import { exec, type ExecException } from "child_process"; + +export async function pullLatest(path: string) { + await promiseExec(`cd "${path}" && git pull`); +} + +export function promiseExec( + cmd: string, +): Promise<{ error: ExecException | null; stdout: string; stderr: string }> { + return new Promise((resolve, _) => { + exec(cmd, (error, stdout, stderr) => { + resolve({ error, stdout, stderr }); + }); + }); +} -- cgit v1.3.1