diff options
| author | Leo Goetz <dev@leogtz.de> | 2026-05-18 10:39:49 +0200 |
|---|---|---|
| committer | Leo Goetz <dev@leogtz.de> | 2026-05-18 10:39:49 +0200 |
| commit | ac820e370dd4e320597b6254deefa10e01da4593 (patch) | |
| tree | 9d73efb690b19a84a0716bb51f8e77698411949f | |
| parent | 3046761a2d6fdd2aa6ea8a973cfadad2fed7fa2e (diff) | |
feat: added error warning when lock is corrupted
| -rw-r--r-- | src/actions/checkDependencies.ts | 9 | ||||
| -rw-r--r-- | src/types.ts | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/actions/checkDependencies.ts b/src/actions/checkDependencies.ts index e728f3a..9766fa4 100644 --- a/src/actions/checkDependencies.ts +++ b/src/actions/checkDependencies.ts @@ -28,7 +28,7 @@ export async function checkDependencies() { if (result.status === "fulfilled") { projectAudits.push(result.value); } else { - console.log("audit failed:", result.reason); + spinner.warn(result.reason); } } @@ -46,7 +46,7 @@ function getAuditPromise( dirname: string, spinner: any, ): Promise<Project> { - return new Promise(async (resolve, _) => { + return new Promise(async (resolve, reject) => { spinner.text = "pulling latest"; await promiseExec(`cd "${path}" && git pull `, () => {}); spinner.text = "getting audit"; @@ -55,6 +55,11 @@ function getAuditPromise( (_: any, stdout: string) => { let output = JSON.parse(stdout); let project: Project = { projectName: dirname, ...output }; + if (project.error) { + reject( + `${dirname} could not be audited, maybe package lock is corrupted`, + ); + } resolve(project); }, ); diff --git a/src/types.ts b/src/types.ts index db84517..e6871c2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -42,4 +42,5 @@ export interface Output { export interface Project extends Output { projectName: string; + error?: string; } |
