fenvdir is a partially compatible clone of envdir(1) from daemontools for the fish shell.
fenvdir sets environment variables to the contents of the non-hidden files in a directory.
fenvdir requires fish 3.4 or later. Earlier versions will not work.
fenvdir dir [-v|--verbose] [command ...]
The flag -v/--verbose prints fish commands
that correspond to setting the environment variables.
It other words,
it converts the directory to a fish script.
For example:
> fenvdir d/ --verbose
set -e empty
set -gx foo bar
set -gx no_newline 'hello fish world'
set -gx null_sep hello\nfish\nworldTo install fenvdir with Fisher, run the command:
fisher install dbohdan/fenvdir- Clone the repository or download and extract a source archive.
- Run
install.fish.
fenvdir is not identical to envdir.
- Like envdir:
- fenvdir trims trailing spaces and tabs.
- fenvdir converts null bytes to line feeds.
- Unlike envdir:
- fenvdir reads whole files into environment variables instead of just their first lines.
- fenvdir requires filenames
to be valid fish shell identifiers.
This means that
foo-baris an acceptable filename for envdir but not fenvdir.
- ev-fish — “Load environment variables from files and directories using fish shell, like envdir”
MIT.