Skip to main content

expand_variable_definitions

Function expand_variable_definitions 

Source
pub fn expand_variable_definitions(
    base_map: &mut Value,
    seed: &mut CaproniConfig,
    lookup: &dyn Lookup,
) -> Result<Vec<Unresolved>, ConfigError>
Expand description

Resolves every variables: entry in place, in both the raw mapping and the seed the resolver is built from, so the resolver and the re-decoded config both serve resolved values. Definitions resolve against predefined variables, tool versions and the environment; they cannot reference each other. A definition takes the ${VAR:-default}, ${VAR:?message} and ${VAR:+text} operators, which config values reject. A file definition expands its path the same way, then reads the file’s content as its value.

Returns the references that resolved to nothing, named with the definition each appeared in, so the caller can fold them into the unresolved-variable warning.