zoi_cli/cmd/env.rs
1use anyhow::Result;
2use clap_complete::Shell;
3use colored::*;
4use zoi_project::{config, environment};
5
6pub fn run(env_alias: Option<String>, export_shell: Option<Shell>) -> Result<()> {
7 let config = config::load()?;
8 if let Some(shell) = export_shell {
9 environment::export_shell(env_alias.as_deref(), &config, shell)?;
10 } else {
11 environment::setup(env_alias.as_deref(), &config)?;
12 println!("\n{}", "Environment setup complete.".green());
13 }
14 Ok(())
15}