resolve_full

Function resolve_full 

Source
pub fn resolve_full(
    template_env: HashMap<String, String>,
    profile_env: HashMap<String, String>,
    workbench_env: HashMap<String, String>,
    feature_env: HashMap<String, String>,
    script_env: HashMap<String, String>,
    preserve_current: bool,
) -> HashMap<String, String>
Expand description

Resolves the final set of environment variables.

This function merges variables from:

  1. Template defaults
  2. Profile-specific static variables
  3. Workbench environment variables
  4. Feature flag variables
  5. Rhai script output
  6. Current process environment

§Arguments

  • template_env - Environment variables from templates
  • profile_env - Environment variables from profile
  • workbench_env - Environment variables from workbench selection
  • feature_env - Environment variables from feature flags
  • script_env - Environment variables from Rhai script
  • preserve_current - Whether to preserve current process environment

§Returns

Final resolved HashMap of environment variables

§Example

use crate::Maintain::Source::Build::Rhai::EnvironmentResolver;

let templates = HashMap::from([("PATH", "/usr/bin".to_string())]);
let profile = HashMap::from([("NODE_ENV", "development".to_string())]);
let workbench = HashMap::from([("Mountain", "true".to_string())]);
let features = HashMap::from([("FEATURE_TAURI_IPC", "true".to_string())]);
let script = HashMap::from([("RUST_LOG", "debug".to_string())]);

let final_env = EnvironmentResolver::resolve_full(
    templates, profile, workbench, features, script, true
);