hooks : on_install/on_start/on_stop/on_update globaux (settings.hooks) et par projet (issue #34) - echec non bloquant, dry-run respecte, ordre global puis projet

This commit is contained in:
2026-08-17 08:55:35 -04:00
parent 30cc49de3c
commit 18784ba9f7
6 changed files with 144 additions and 0 deletions
+7
View File
@@ -73,6 +73,10 @@ pub struct Settings {
/// --theme flag overrides it).
#[serde(default)]
pub theme: Option<String>,
/// Lifecycle hooks: on_install / on_start / on_stop / on_update command
/// lines (global; project profiles can add their own).
#[serde(default)]
pub hooks: BTreeMap<String, Vec<String>>,
}
/// A project profile: everything am needs to know about one project.
@@ -497,6 +501,9 @@ pub fn merge(base: &mut Config, overlay: Config) {
if o.self_update_repo.is_some() {
s.self_update_repo = o.self_update_repo;
}
for (k, v) in o.hooks {
s.hooks.insert(k, v);
}
for (k, v) in overlay.aliases {
base.aliases.insert(k, v);
}