Files
AeroPkg/src/commands/run/config.rs

25 lines
901 B
Rust
Raw Normal View History

2025-11-18 19:46:36 +03:00
use crate::commands::link::link;
use crate::utils::parser::{self, env::get_install_env};
2026-09-10 23:05:56 +03:00
use crate::utils::shell;
2025-11-18 19:46:36 +03:00
pub fn config(repo: &String, pkgname: &String) {
2026-06-12 18:37:44 +03:00
let pkg_dir = &crate::commands::get_aeropkg_base().join(repo).join(pkgname);
let pkg_md_path = &crate::commands::get_aeropkg_var().join(format!("{}/{}.md", repo, pkgname));
2025-11-18 19:46:36 +03:00
let config_script = match parser::get_config_script(pkg_md_path) {
Ok(script) => script,
Err(_) => { return }
2025-11-18 19:46:36 +03:00
};
let full_env = get_install_env(repo, pkgname, pkg_md_path, "config");
2026-09-10 23:05:56 +03:00
shell::run_install_script(&config_script, pkg_dir, &full_env);
shell::run_install_repo_stage_hook_script(repo, "config", &full_env);
shell::run_install_stage_hook_script("download", &full_env);
2025-11-18 19:46:36 +03:00
2026-09-10 17:33:37 +03:00
if !crate::commands::get_aeropkg_base().join(repo).join(pkgname).join("disabled").exists() {
link(repo, pkgname)
}
2025-11-18 19:46:36 +03:00
}