2025-11-18 19:46:36 +03:00
|
|
|
use crate::commands::link::link;
|
|
|
|
|
use crate::utils::parser::{self, env::get_install_env};
|
|
|
|
|
use crate::utils::shell::{run_install_script,run_install_script_hook};
|
|
|
|
|
|
|
|
|
|
|
2026-03-27 13:13:52 +03:00
|
|
|
pub fn config(repo: &String, pkgname: &String) {
|
|
|
|
|
let src_dir = &crate::commands::get_aeropkg_base().join("src").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,
|
2026-03-27 13:13:52 +03:00
|
|
|
Err(_) => { return }
|
2025-11-18 19:46:36 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let full_env = get_install_env(repo, pkgname, pkg_md_path, "config");
|
2026-03-27 13:13:52 +03:00
|
|
|
run_install_script(&config_script, src_dir, &full_env);
|
|
|
|
|
run_install_script_hook(repo, "config", &full_env);
|
2025-11-18 19:46:36 +03:00
|
|
|
|
2026-03-27 13:13:52 +03:00
|
|
|
link(repo, pkgname)
|
2025-11-18 19:46:36 +03:00
|
|
|
}
|