Skip to main content

zoi_cli/cmd/
run.rs

1//! Running project-specific commands and aliases.
2
3use anyhow::Result;
4use zoi_project::{config, runner};
5
6/// Runs a project command or alias.
7///
8/// This loads the project configuration and executes the requested command or
9/// alias with the provided arguments.
10///
11/// # Errors
12///
13/// Returns an error if the project configuration cannot be loaded or if the
14/// command execution fails.
15pub fn run(cmd_alias: Option<&str>, args: &[String]) -> Result<()> {
16    let config = config::load()?;
17    runner::run(cmd_alias, args, &config)
18}