Skip to content

Commit e082d66

Browse files
fix: catch file errors on existence check
1 parent 8e4eaa6 commit e082d66

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/utils.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,12 @@ export class JsrPackage {
4545
}
4646

4747
async function fileExists(file: string): Promise<boolean> {
48-
const stat = await fs.promises.stat(file);
49-
return stat.isFile();
48+
try {
49+
const stat = await fs.promises.stat(file);
50+
return stat.isFile();
51+
} catch (err) {
52+
return false;
53+
}
5054
}
5155

5256
export async function findLockFile(dir: string): Promise<string> {

0 commit comments

Comments
 (0)