diff options
| author | Leo Goetz <dev@leogtz.de> | 2026-05-19 07:51:52 +0200 |
|---|---|---|
| committer | Leo Goetz <dev@leogtz.de> | 2026-05-19 07:51:52 +0200 |
| commit | 3535855bc0df3460b7abe0cb2860a677fa50a435 (patch) | |
| tree | 32b5cc0ae52ab8319a4f6319aba591ec45a50a28 | |
| parent | 0218e0e6930ff41073958c5e3f9dc3ae5b2574d1 (diff) | |
fix: added spinner to each function that needs it
| -rw-r--r-- | src/actions/checkDependencies.ts | 9 |
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 `, () => {}); } |
