diff options
Diffstat (limited to 'crates/core/search.rs')
-rw-r--r-- | crates/core/search.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/crates/core/search.rs b/crates/core/search.rs index 4da4057b..c57e9ee6 100644 --- a/crates/core/search.rs +++ b/crates/core/search.rs @@ -115,9 +115,14 @@ impl SearchWorkerBuilder { pub fn preprocessor( &mut self, cmd: Option<PathBuf>, - ) -> &mut SearchWorkerBuilder { - self.config.preprocessor = cmd; - self + ) -> crate::Result<&mut SearchWorkerBuilder> { + if let Some(ref prog) = cmd { + let bin = cli::resolve_binary(prog)?; + self.config.preprocessor = Some(bin); + } else { + self.config.preprocessor = None; + } + Ok(self) } /// Set the globs for determining which files should be run through the |