mirror of
https://github.com/sharkdp/fd.git
synced 2024-11-18 01:40:34 +01:00
--exec: Do not exit on errors
This commit is contained in:
parent
046b0574dc
commit
56b6389dac
1 changed files with 7 additions and 8 deletions
|
@ -7,7 +7,7 @@
|
||||||
// according to those terms.
|
// according to those terms.
|
||||||
|
|
||||||
use super::CommandTemplate;
|
use super::CommandTemplate;
|
||||||
use internal::print_error_and_exit;
|
use internal::print_error;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::sync::mpsc::Receiver;
|
use std::sync::mpsc::Receiver;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
@ -25,15 +25,14 @@ pub fn job(
|
||||||
// Create a lock on the shared receiver for this thread.
|
// Create a lock on the shared receiver for this thread.
|
||||||
let lock = rx.lock().unwrap();
|
let lock = rx.lock().unwrap();
|
||||||
|
|
||||||
// Obtain the next path from the receiver, else if the channel
|
// Obtain the next result from the receiver, else if the channel
|
||||||
// has closed, exit from the loop
|
// has closed, exit from the loop
|
||||||
let value: PathBuf = match lock.recv() {
|
let value: PathBuf = match lock.recv() {
|
||||||
Ok(value) => match value {
|
Ok(WorkerResult::Entry(val)) => val,
|
||||||
WorkerResult::Entry(val) => val,
|
Ok(WorkerResult::Error(err)) => {
|
||||||
WorkerResult::Error(err) => {
|
print_error(&format!("{}", err));
|
||||||
print_error_and_exit(&format!("{}", err));
|
continue;
|
||||||
}
|
}
|
||||||
},
|
|
||||||
Err(_) => break,
|
Err(_) => break,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue