From 3535855bc0df3460b7abe0cb2860a677fa50a435 Mon Sep 17 00:00:00 2001 From: Leo Goetz Date: Tue, 19 May 2026 07:51:52 +0200 Subject: fix: added spinner to each function that needs it --- src/actions/checkDependencies.ts | 9 +++++---- 1 file 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 { 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 `, () => {}); } -- cgit v1.3.1