Skip to content

Commit

Permalink
Fix denoland#158 handle properly dependencies cache when deno/deps do…
Browse files Browse the repository at this point in the history
…es not exists (denoland#169)

Co-authored-by: Jose Danilo Sampaio da Silva (Venturus) <jose.sampaio@dmz.org.br>
  • Loading branch information
2 people authored and CGQAQ committed Sep 13, 2020
1 parent 1a70369 commit 14a9985
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/deno_deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@ export type Range = {
export async function getAllDenoCachedDeps(): Promise<Deps[]> {
const depsRootDir = getDenoDepsDir();
const deps: Deps[] = [];
const protocols = await fs.readdir(depsRootDir);
let protocols: string[] = [];

try {
protocols = await fs.readdir(depsRootDir);
} catch (error) {
//deno/deps directory does not exists
if (error.code === "ENOENT") {
return deps;
}
}

await Promise.all(
protocols.map(async (protocol) => {
Expand Down

0 comments on commit 14a9985

Please sign in to comment.