Skip to content

Commit 993afc8

Browse files
authored
feat(dotenv): add named pipe (FIFO) support (ohmyzsh#13561)
1 parent a8aca3f commit 993afc8

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

plugins/dotenv/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ change.
7878
NOTE: if a directory is found in both the allowed and disallowed lists, the disallowed list
7979
takes preference, _i.e._ the .env file will never be sourced.
8080

81+
## Named Pipe (FIFO) Support
82+
83+
The plugin supports `.env` files provided as UNIX named pipes (FIFOs) in addition to regular files.
84+
This is useful when secrets managers like [1Password Environments](https://developer.1password.com/docs/environment/)
85+
mount `.env` files as named pipes to inject secrets on-the-fly without writing them to disk.
86+
87+
No additional configuration is required — the plugin automatically detects and sources named pipes.
88+
8189
## Version Control
8290

8391
**It's strongly recommended to add `.env` file to `.gitignore`**, because usually it contains sensitive information such as your credentials, secret keys, passwords etc. You don't want to commit this file, it's supposed to be local only.

plugins/dotenv/dotenv.plugin.zsh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
## Functions
1212

1313
source_env() {
14-
if [[ ! -f "$ZSH_DOTENV_FILE" ]]; then
14+
if [[ ! -f "$ZSH_DOTENV_FILE" ]] && [[ ! -p "$ZSH_DOTENV_FILE" ]]; then
1515
return
1616
fi
1717

0 commit comments

Comments
 (0)