diff options
Diffstat (limited to 'src/actions/checkDependencies.ts')
| -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 `, () => {}); } |
