Skip to content
/ envd Public

An envdir replacement improved for interactive use.

Notifications You must be signed in to change notification settings

tsibley/envd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

usage: envd <name> [<name>] [<name>=<value>] -- <command> [arguments…]
       envd <name> [<name>] [<name>=<value>]
       envd --list | -l
       envd --help | -h

An envdir replacement improved for interactive use.

Runs the given <command> with optional [arguments…] after modifying the
environment using the named environment directories (envdirs).

Named envdirs are found by looking inside "env.d" directories found in the
current directory and upwards in the directory hierarchy.  The search stops
when it hits the filesystem root (/) or $HOME.  If you're within the safety
of your home directory, this ensures you won't pick up env.d directories
potentially outside of your control.  Run "envd --list" from any directory to
see the env.d directories under consideration for that location.

Any argument starting with a slash (/) will be treated as an absolute path to
an envdir.  Any argument starting with "../" will be treated as a relative
path to an envdir.  Other relative paths may be given if they do not also
match a named envdir in any of the searched "env.d" directories.

Any arguments which contain an equals sign will be treated as an ad-hoc
key-value pair to inject into the environment (similar to the "env" command's
syntax) as if it was an entry in an envdir.

Any <command> must be separated from envdir <name>s by a double hyphen (--).

If no <command> is given, "env" is run which will print the contents of the
environment.

Bash completion is available for <name>s and options.  Enable it by adding
the following to your ~/.bashrc file:

    source <(envd --complete)

As an example, given the following:

    $ pwd
    /home/tom/seattleflu/backoffice/id3c-production

    $ envd --list
    /home/tom/seattleflu/backoffice/id3c-production/env.d
      redcap-kiosk
      redcap-swab-n-send
      uwsgi

    /home/tom/seattleflu/env.d
      id3c
      slack-webhook-test

    /home/tom/env.d
      github
      swift-v1-bedford
      swift-v1-tsibley
      swift-v2

Then

    envd redcap-kiosk id3c -- <command>

is equivalent to:

    envdir /home/tom/seattleflu/backoffice/id3c-production/env.d/redcap-kiosk \
      envdir /home/tom/seattleflu/env.d/id3c \
        <command>

About

An envdir replacement improved for interactive use.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages