feat: fix error message
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2024-11-24 00:54:19 +01:00
parent d1e9eb9eb5
commit 32cd1cc617
Signed by: kjuulh
GPG Key ID: D85D7535F18F35FA

View File

@ -1,3 +1,5 @@
use anyhow::Context;
use super::agent_state::AgentState;
#[derive(Clone)]
@ -89,7 +91,7 @@ impl Task {
pub async fn execute(&self) -> anyhow::Result<()> {
let mut cmd = tokio::process::Command::new("apt");
cmd.args(["apt-get", "update", "-q"]);
let output = cmd.output().await?;
let output = cmd.output().await.context("failed to run apt update")?;
match output.status.success() {
true => tracing::info!("successfully ran apt update"),
false => {
@ -103,7 +105,7 @@ impl Task {
let mut cmd = tokio::process::Command::new("apt");
cmd.env("DEBIAN_FRONTEND", "noninteractive")
.args(["apt-get", "upgrade", "-y"]);
let output = cmd.output().await?;
let output = cmd.output().await.context("failed to run apt upgrade")?;
match output.status.success() {
true => tracing::info!("successfully ran apt upgrade"),
false => {