From 4efd828912a2e0d8a36efb073f07b4b06db8066c Mon Sep 17 00:00:00 2001 From: JMARyA Date: Fri, 27 Jun 2025 21:44:36 +0200 Subject: [PATCH] no autofail --- src/linux.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/linux.rs b/src/linux.rs index d3d2c97..bc76b8b 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -1,7 +1,7 @@ use nix::{unistd::Uid, unistd::getuid}; use std::{io::Write, os::unix::fs::PermissionsExt}; -use crate::print_status; +use crate::{expect_yes, print_status}; pub fn is_root() -> bool { getuid() == Uid::from_raw(0) @@ -78,7 +78,6 @@ pub fn run_command(cmd: &[&str], input: Option<&str>, inherit: bool) -> (String, } let status = child.wait_with_output().unwrap(); - assert!(status.status.success()); let output = String::from_utf8(status.stdout).unwrap(); let stderr = String::from_utf8(status.stderr).unwrap(); @@ -91,6 +90,14 @@ pub fn run_command(cmd: &[&str], input: Option<&str>, inherit: bool) -> (String, println!("{output}"); } + if !status.status.success() { + println!( + "Command '{}' failed. Do you want to continue still? Type 'yes'", + cmd.join(" ") + ); + expect_yes(); + } + (output, stderr) }