fix: Add check in task subprocess for task uuid

This commit is contained in:
Dheepak Krishnamurthy 2021-10-31 00:31:24 -06:00
parent 8766b0c64d
commit 2f8f245a97

View file

@ -1618,9 +1618,11 @@ impl TaskwarriorTui {
return Ok(());
}
let task_uuids = self.selected_task_uuids();
let shell = self.command.as_str();
match shlex::split(shell) {
let r = match shlex::split(shell) {
Some(cmd) => {
// first argument must be a binary
let mut command = Command::new(&cmd[0]);
@ -1638,9 +1640,17 @@ impl TaskwarriorTui {
}
}
None => Err(format!("Cannot run subprocess. Unable to shlex split `{}`", shell)),
};
if task_uuids.len() == 1 {
if let Some(uuid) = task_uuids.get(0) {
self.current_selection_uuid = Some(*uuid);
}
}
r
}
pub fn task_log(&mut self) -> Result<(), String> {
if self.tasks.is_empty() {
return Ok(());