manager: add update_meta_inputs tool to update flake.lock on demand (closes #235)
This commit is contained in:
parent
15e44955a8
commit
597e4ba03a
5 changed files with 76 additions and 8 deletions
|
|
@ -311,6 +311,22 @@ async fn dispatch(req: &ManagerRequest, coord: &Arc<Coordinator>) -> ManagerResp
|
|||
},
|
||||
}
|
||||
}
|
||||
ManagerRequest::UpdateMetaInputs { inputs } => {
|
||||
let label = if inputs.is_empty() {
|
||||
"all inputs".to_string()
|
||||
} else {
|
||||
inputs.join(", ")
|
||||
};
|
||||
tracing::info!(%label, "manager: update_meta_inputs");
|
||||
// Treat empty list as "update all" by passing the full list
|
||||
// to lock_update; it calls bare `nix flake update` when empty.
|
||||
match crate::meta::lock_update(inputs).await {
|
||||
Ok(()) => ManagerResponse::Ok,
|
||||
Err(e) => ManagerResponse::Err {
|
||||
message: format!("update_meta_inputs({label}): {e:#}"),
|
||||
},
|
||||
}
|
||||
}
|
||||
ManagerRequest::Ask {
|
||||
question,
|
||||
options,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue