Add new config continue_when_run_failed

This commit is contained in:
2024-08-25 10:56:40 +08:00
parent 458ae1cbfa
commit 88e30a0185
2 changed files with 7 additions and 1 deletions

View File

@@ -150,4 +150,10 @@ impl Config {
.map(|s| s.to_owned())
.unwrap_or(true)
}
pub fn continue_when_run_failed(&self) -> bool {
self.get_bool("continue_when_run_failed")
.map(|s| s.to_owned())
.unwrap_or(false)
}
}

View File

@@ -221,7 +221,7 @@ impl Main {
};
if !ok {
println!("Run failed: {:?}.", e);
if !utils::ask_continue() {
if !self._cfg.continue_when_run_failed() && !utils::ask_continue() {
return Err(Error::Exited);
}
}