diff --git a/src/read-env-file.ts b/src/read-env-file.ts index 2b4c03479..228e1b252 100644 --- a/src/read-env-file.ts +++ b/src/read-env-file.ts @@ -9,8 +9,8 @@ import {readFile, stat} from 'node:fs/promises'; // TODO string-template-parser export async function readEnvFile(filepath: string, entries: Array<[string, string]>): Promise { - const fileStat = await stat(filepath); - if (!fileStat.isFile()) { + const fileStat = await stat(filepath).catch(() => null); + if (!fileStat || !fileStat.isFile()) { console.warn('Skipping non-file env file: ' + filepath); return; }