From b4015801f9859785b63a673a502701ed556849e1 Mon Sep 17 00:00:00 2001 From: reuben olinsky Date: Thu, 24 Oct 2024 20:38:07 -0700 Subject: [PATCH] fix: omit dirs from executable searches --- brush-core/src/shell.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/brush-core/src/shell.rs b/brush-core/src/shell.rs index c9ec86d8..d1a4b7d0 100644 --- a/brush-core/src/shell.rs +++ b/brush-core/src/shell.rs @@ -895,7 +895,7 @@ impl Shell { /// * `required_glob_pattern` - The glob pattern to match against. #[allow(clippy::manual_flatten)] pub fn find_executables_in_path(&self, required_glob_pattern: &str) -> Vec { - let is_executable = |path: &Path| path.executable(); + let is_executable = |path: &Path| path.is_file() && path.executable(); let mut executables = vec![]; for dir_str in self.env.get_str("PATH").unwrap_or_default().split(':') {