load-env for filesystem
Loads an environment update from a record.
Command Type
built-in
Signature
> load-env {flags} (update)
Parameters
update: The record to use for updates.
Input/output types:
| input | output |
|---|---|
| record | nothing |
| nothing | nothing |
| any | nothing |
Examples
Load variables from an input stream.
> {NAME: ABE, AGE: UNKNOWN} | load-env; $env.NAME
ABELoad variables from an argument.
> load-env {NAME: ABE, AGE: UNKNOWN}; $env.NAME
ABELoad a variable, then apply its environment conversion.
> $env.ENV_CONVERSIONS = {MY_ENV_VAR: {from_string: { split row ':' }}}; load-env {MY_ENV_VAR: 'foo:bar'}; $env.ENV_CONVERSIONS = $env.ENV_CONVERSIONS; $env.MY_ENV_VAR
╭───┬─────╮
│ 0 │ foo │
│ 1 │ bar │
╰───┴─────╯Notes
Environment conversions are not applied automatically. To apply the conversions configured in $env.ENV_CONVERSIONS after loading an update, assign $env.ENV_CONVERSIONS to itself.