environment()

Returns an empty env object.

Signature

(since 0.35.0)

# Returns an empty env object.
env environment(
  str | array[str] | dict[str] | dict[array[str]] [env],   # If provided, each key/value pair is added into the env object

  # Keyword arguments:
  method    : str  # Must be one of 'set', 'prepend', or 'append'
  separator : str  # The separator to use for the initial values defined in
)

Arguments

Argument flattening is NOT SUPPORTED by this function.

The function environment() accepts the following positional arguments:

Name Type Description Tags
env str | array[str] | dict[str] | dict[array[str]]

If provided, each key/value pair is added into the env object as if env.set() method was called for each of them. Since 0.62.0 arrays of strings are allowed in dictionary values. In that case values are joined using the separator.

(since 0.52.0)

[optional]

Finally, environment() accepts the following keyword arguments:

Name Type Description Tags
method str

Must be one of 'set', 'prepend', or 'append' (defaults to 'set'). Controls if initial values defined in the first positional argument are prepended, appended or replace the current value of the environment variable.

(since 0.62.0)

separator str

The separator to use for the initial values defined in the first positional argument. If not explicitly specified, the default path separator for the host operating system will be used, i.e. ';' for Windows and ':' for UNIX/POSIX systems.

(since 0.62.0)

The results of the search are