mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-24 14:36:42 +02:00
feat: Better error messages for task_shortcut ✨
This commit is contained in:
parent
581cc4aa56
commit
9482c5caf7
1 changed files with 5 additions and 5 deletions
10
src/app.rs
10
src/app.rs
|
@ -1884,8 +1884,8 @@ impl TaskwarriorTui {
|
||||||
let r = match shlex::split(&shell) {
|
let r = match shlex::split(&shell) {
|
||||||
Some(cmd) => {
|
Some(cmd) => {
|
||||||
let mut command = std::process::Command::new(&cmd[0]);
|
let mut command = std::process::Command::new(&cmd[0]);
|
||||||
for s in cmd.iter().skip(1) {
|
for i in cmd.iter().skip(1) {
|
||||||
command.arg(s);
|
command.arg(i);
|
||||||
}
|
}
|
||||||
if let Ok(child) = command.spawn() {
|
if let Ok(child) = command.spawn() {
|
||||||
let output = child.wait_with_output();
|
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 {
|
} 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 {
|
if task_uuids.len() == 1 {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue