Support named pipes when loading .env files (#70725)
### What? Updates `@next/env` to support loading `.env` "files" that are named pipes. ### Why? Some third party secret managers (like [Doppler](https://docs.doppler.com/docs/accessing-secrets#mounting)) have CLIs that can "mount" a `.env` file. This "file" is actually a named pipe, which prevents the secrets from being stored on disk, but otherwise acts exactly like a file. The check in `@next/env` prevents this from working because `isFile()` returns false for named pipes. ### How? When loading potential `.env` files, an `fs.statSync()` is performed and then `isFile()` is called. If that's false, the potential file is skipped. This includes named pipes. The change is very simple and just updates the check so it looks at `isFile()` _and_ `isFIFO()`, which returns true for named pipes. Co-authored-by:JJ Kasper <jj@jjsweb.site>
Showing
Please
register
or
sign in
to comment