Skip to main content

load_zoi_lua

Function load_zoi_lua 

Source
pub fn load_zoi_lua(
    path: &Path,
    env: HashMap<String, String>,
) -> Result<ProjectConfig>
Expand description

Parses and executes a zoi.lua file to load project-specific configuration.

This is the core of Zoi Specification v2. It:

  • Exposes a declarative API (project, packages, tasks, etc.) to Lua.
  • Executes the script, capturing metadata into temporary thread-safe maps.
  • Resolves script-level choices into a static ProjectConfig struct.

This allows project environments to be programmable, enabling logic like conditionally selecting registries based on environment variables.