Dynamic environment
Omni provides a dynamic environment for repositories. During omni up
, omni will store the environment that needs loading when you navigate to the current repository.
Configuration
The following configuration parameters lead to dynamic environment.
Configuration | Dynamic environment |
---|---|
env | Each entry in the map leads to setting an environment variable to the defined value |
bash operation | See details |
bundler operation | See details |
go operation | See details |
node operation | See details |
python operation | See details |
ruby operation | See details |
rust operation | See details |
terraform operation | See details |
Behind the scene
The __omni_dynenv
environment variable
Omni's dynamic environment is set when entering an omni up
-ed repository directory, and updated or unset when leaving this directory. Omni uses the __omni_dynenv
environment variable to keep track of this.
This variable is structured with a blake3 hash, semicolon-separated from a JSON object. The hash allows to easily identify if the current dynamic environment corresponds to the expected one. The JSON object indicates all the changes that have been operated on the environment.
This is inspired from the way shadowenv
keeps track of environment changes so it can restore the environment when leaving a directory.