Skip to content

dbohdan/fenvdir

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fenvdir

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.

Contents

Requirements

fenvdir requires fish 3.4 or later. Earlier versions will not work.

Usage

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\nworld

Installation

Using Fisher

To install fenvdir with Fisher, run the command:

fisher install dbohdan/fenvdir

Manual

  1. Clone the repository or download and extract a source archive.
  2. Run install.fish.

Comparison with envdir

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-bar is an acceptable filename for envdir but not fenvdir.

Alternatives

  • ev-fish — “Load environment variables from files and directories using fish shell, like envdir”

License

MIT.

Releases

No releases published

Packages

No packages published

Languages