aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/by-name
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name')
-rw-r--r--pkgs/by-name/ts/tskm/src/task/mod.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/pkgs/by-name/ts/tskm/src/task/mod.rs b/pkgs/by-name/ts/tskm/src/task/mod.rs
index 04efbec5..9c671273 100644
--- a/pkgs/by-name/ts/tskm/src/task/mod.rs
+++ b/pkgs/by-name/ts/tskm/src/task/mod.rs
@@ -10,14 +10,14 @@
use std::{
fmt::Display,
- fs::{self, File, read_to_string},
+ fs::{self, read_to_string, File},
path::PathBuf,
process::Command,
str::FromStr,
sync::OnceLock,
};
-use anyhow::{Context, Result, bail};
+use anyhow::{bail, Context, Result};
use log::{debug, info, trace};
use taskchampion::Tag;
@@ -76,7 +76,6 @@ impl Task {
pub fn uuid(&self) -> &taskchampion::Uuid {
&self.uuid
}
- #[must_use]
pub fn working_set_id(&self, state: &mut State) -> Result<usize> {
Ok(state
.replica()
@@ -356,5 +355,13 @@ pub(crate) fn run_task(args: &[&str]) -> Result<String> {
trace!("Output (stdout): '{}'", stdout.trim());
trace!("Output (stderr): '{}'", stderr.trim());
+ if !output.status.success() {
+ bail!(
+ "Command `task {}` failed with status: {}",
+ args.join(" "),
+ output.status
+ );
+ }
+
Ok(stdout.trim().to_owned())
}