events : instrumentation start/stop/run/install/update/uninstall/doctor/repl/shell (issue #3) - un evenement JSONL par action reelle, dry-run sans evenement, session id sur start, duree et exit code sur stop/run
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
//! reinstall when an update exists.
|
||||
|
||||
use super::*;
|
||||
use crate::events::{Event, EventKind};
|
||||
use crate::installers;
|
||||
use crate::runner::{Runner, SystemRunner};
|
||||
use anyhow::{bail, Result};
|
||||
@@ -96,6 +97,11 @@ fn update_one(app: &App, runner: &dyn Runner, name: &str) -> Result<i32> {
|
||||
new_entry.updated_at = Some(installers::now_rfc3339());
|
||||
let version = new_entry.version.clone().unwrap_or_else(|| "unknown".to_string());
|
||||
app.state.set(&new_entry)?;
|
||||
app.emit(
|
||||
&Event::now(EventKind::Update)
|
||||
.with_agent(agent.name.clone())
|
||||
.with_args(vec![format!("method={}", method.kind)]),
|
||||
);
|
||||
app.log.success(&format!(
|
||||
"updated {} to v{version}",
|
||||
agent.title()
|
||||
|
||||
Reference in New Issue
Block a user