summaryrefslogtreecommitdiff
path: root/src/utils/helper.ts
diff options
context:
space:
mode:
authorLeo Goetz <dev@leogtz.de>2026-05-24 06:50:57 +0200
committerLeo Goetz <dev@leogtz.de>2026-05-24 06:50:57 +0200
commitca8537af0ab596fddd8d72e6630f278326ef5360 (patch)
tree170d9f82b28f292f40785e33b3981121b6793c3c /src/utils/helper.ts
parentd05bfaf95fb666fea02c8aceae3ce02c9e315d3d (diff)
feat: added fix functionality
Diffstat (limited to 'src/utils/helper.ts')
-rw-r--r--src/utils/helper.ts15
1 files changed, 15 insertions, 0 deletions
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 });
+ });
+ });
+}