Skip to content

Commit 20b77d5

Browse files
committed
fix fs.stat
1 parent 23597c3 commit 20b77d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/read-env-file.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import {readFile, stat} from 'node:fs/promises';
99
// TODO string-template-parser
1010

1111
export async function readEnvFile(filepath: string, entries: Array<[string, string]>): Promise<void> {
12-
const fileStat = await stat(filepath);
13-
if (!fileStat.isFile()) {
12+
const fileStat = await stat(filepath).catch(() => null);
13+
if (!fileStat || !fileStat.isFile()) {
1414
console.warn('Skipping non-file env file: ' + filepath);
1515
return;
1616
}

0 commit comments

Comments
 (0)