Skip to content

Commit

Permalink
fix fs.stat
Browse files Browse the repository at this point in the history
  • Loading branch information
sirenkovladd committed Nov 18, 2023
1 parent 23597c3 commit d54e27f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/read-env-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
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;
}
Expand Down

0 comments on commit d54e27f

Please sign in to comment.