mirror of
https://github.com/kdheepak/taskwarrior-tui.git
synced 2025-08-25 17:57:19 +02:00
Fix recur task add crash
This commit is contained in:
parent
453f7366f7
commit
e0a401dc66
1 changed files with 12 additions and 10 deletions
12
src/app.rs
12
src/app.rs
|
@ -1624,18 +1624,20 @@ impl TaskwarriorTuiApp {
|
|||
let output = command.output();
|
||||
match output {
|
||||
Ok(output) => {
|
||||
if output.status.code() != Some(0) {
|
||||
Err(format!("Error: {}", String::from_utf8_lossy(&output.stderr)))
|
||||
} else {
|
||||
let data = String::from_utf8_lossy(&output.stdout);
|
||||
let re = Regex::new(r"^Created task (?P<task_id>\d+).\n$").unwrap();
|
||||
let caps = re.captures(&data).unwrap();
|
||||
if self.config.uda_task_report_jump_to_task_on_add {
|
||||
if let Some(caps) = re.captures(&data) {
|
||||
self.current_selection_id = Some(caps["task_id"].parse::<u64>().unwrap());
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
Err(_) => Err(format!(
|
||||
"Cannot run `task add {}`. Check documentation for more information",
|
||||
shell
|
||||
)),
|
||||
}
|
||||
Err(e) => Err(format!("Cannot run `task add {}`. {}", shell, e.to_string(),)),
|
||||
}
|
||||
}
|
||||
None => Err(format!("Unable to run `task add`. Cannot shlex split `{}`", shell)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue