diff options
Diffstat (limited to 'src')
| -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; } |
