File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ function M.find_files(start_dir, file_name)
13
13
-- Create the find command with appropriate flags for recursive searching
14
14
local find_command
15
15
if package.config :sub (1 , 1 ) == " \\ " then -- Windows
16
- find_command = string.format (' dir /s /b /a:-D "%s\\ %s" 2>NUL ' , start_dir , file_name )
16
+ find_command = string.format (' powershell.exe -Command "Get-ChildItem -Path \\ "%s\\ " -Recurse -Filter \\ "%s \\ " -File -Exclude \\ ".git \\ " -ErrorAction SilentlyContinue" ' , start_dir , file_name )
17
17
else -- UNIX-like systems
18
- find_command = string.format (' find "%s" -type f -name "%s" 2>/dev/null' , start_dir , file_name )
18
+ find_command = string.format (' find "%s" -type d -name ".git" -prune -o -type f -name "%s" -print 2>/dev/null' , start_dir , file_name )
19
19
end
20
20
21
21
-- Execute the find command and capture the output
You can’t perform that action at this time.
0 commit comments