summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLeo Goetz <dev@leogtz.de>2026-05-19 07:51:52 +0200
committerLeo Goetz <dev@leogtz.de>2026-05-19 07:51:52 +0200
commit3535855bc0df3460b7abe0cb2860a677fa50a435 (patch)
tree32b5cc0ae52ab8319a4f6319aba591ec45a50a28 /src
parent0218e0e6930ff41073958c5e3f9dc3ae5b2574d1 (diff)
fix: added spinner to each function that needs it
Diffstat (limited to 'src')
-rw-r--r--src/actions/checkDependencies.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/actions/checkDependencies.ts b/src/actions/checkDependencies.ts
index 472c24c..ab0f182 100644
--- a/src/actions/checkDependencies.ts
+++ b/src/actions/checkDependencies.ts
@@ -1,5 +1,5 @@
import fs from "fs/promises";
-import ora from "ora";
+import ora, { type Ora } from "ora";
import type { Config, Project } from "../types.js";
import { getConfig } from "../utils/config.js";
import { exec } from "child_process";
@@ -23,7 +23,7 @@ export async function checkDependencies() {
const projectDir = await fs.readdir(dirFullPath);
if (projectDir.includes("package.json")) {
- let auditPromise = getAuditPromise(dirFullPath, entry.name);
+ let auditPromise = getAuditPromise(dirFullPath, entry.name, spinner);
projects.push(auditPromise);
}
}
@@ -42,9 +42,10 @@ export async function checkDependencies() {
async function getAuditPromise(
path: string,
dirname: string,
+ spinner: Ora,
): Promise<Project> {
return new Promise(async (resolve, reject) => {
- await pullLatest(path);
+ await pullLatest(path, spinner);
spinner.text = "getting audit";
promiseExec(
@@ -63,7 +64,7 @@ async function getAuditPromise(
});
}
-async function pullLatest(path: string) {
+async function pullLatest(path: string, spinner: Ora) {
spinner.text = "pulling latest";
await promiseExec(`cd "${path}" && git pull `, () => {});
}