Skip to content

Commit

Permalink
feat: more verbose failing
Browse files Browse the repository at this point in the history
  • Loading branch information
tanishqmanuja committed Apr 1, 2024
1 parent 10c10ae commit 01cdb52
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,20 @@ async function processConfig(config: Config) {
})
);

spinner.succeed(
`Downloaded [${p.filter((p) => p.status === "fulfilled").length}/${
p.length
}] apps`
);
const isRejected = (
input: PromiseSettledResult<unknown>
): input is PromiseRejectedResult => input.status === "rejected";

spinner.stop();
p.filter(isRejected).forEach((p) => console.error(p.reason));

if (p.some((p) => p.status === "fulfilled")) {
spinner.succeed(
`Downloaded [${p.filter((p) => p.status === "fulfilled").length}/${
p.length
}] apps`
);
}
}

resolveConfigPath()
Expand Down

0 comments on commit 01cdb52

Please sign in to comment.