Commit 318ff7b
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 <[email protected]>1 parent ffc326c commit 318ff7b
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
152 | | - | |
| 151 | + | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
0 commit comments