import fs from 'fs'; import path from 'path'; export function defaultFileOrder(cwd: string, env: string) { return [ path.join(cwd, '.env'), path.join(cwd, `.env.${env}`), path.join(cwd, '.env.local'), path.join(cwd, `.env.${env}.local`), ]; } export function existing(files: string[]) { return files.filter((f) => { try { return fs.existsSync(f); } catch { return false; } }); }