feat: Better error messages for task_shortcut

This commit is contained in:
Dheepak Krishnamurthy 2023-05-30 11:30:19 -04:00
parent 581cc4aa56
commit 9482c5caf7

View file

@ -1884,8 +1884,8 @@ impl TaskwarriorTui {
let r = match shlex::split(&shell) {
Some(cmd) => {
let mut command = std::process::Command::new(&cmd[0]);
for s in cmd.iter().skip(1) {
command.arg(s);
for i in cmd.iter().skip(1) {
command.arg(i);
}
if let Ok(child) = command.spawn() {
let output = child.wait_with_output();
@ -1903,13 +1903,13 @@ impl TaskwarriorTui {
))
}
}
Err(s) => Err(format!("`{}` failed: {}", shell, s)),
Err(s) => Err(format!("`{}` failed to wait with output: {}", shell, s)),
}
} else {
Err(format!("`{}` failed: {}", shell, s))
Err(format!("`{}` failed: Unable to spawn shortcut number {}", shell, s))
}
}
None => Err(format!("Unable to run shortcut `{}`: shlex::split(`{}`) failed.", s, shell)),
None => Err(format!("Unable to run shortcut number {}: shlex::split(`{}`) failed.", s, shell)),
};
if task_uuids.len() == 1 {