feat: Listen for ctrl-c

before ctrl-c would not cancel a running job.
This commit is contained in:
andy.boot
2024-03-14 21:14:02 +00:00
parent 0364cf781e
commit b54a215805
5 changed files with 99 additions and 50 deletions
+3
View File
@@ -130,6 +130,9 @@ fn ignore_file(entry: &DirEntry, walk_data: &WalkData) -> bool {
fn walk(dir: PathBuf, walk_data: &WalkData, depth: usize) -> Option<Node> {
let prog_data = &walk_data.progress_data;
let errors = &walk_data.errors;
if errors.lock().unwrap().abort {
return None;
}
let children = if dir.is_dir() {
let read_dir = fs::read_dir(&dir);