feat: add Windows support for git directory scanning (#1391)
This commit is contained in:
@@ -715,6 +715,18 @@ function M.scan_directory(options)
|
|||||||
if not cmd then
|
if not cmd then
|
||||||
local p = Path:new(options.directory)
|
local p = Path:new(options.directory)
|
||||||
if p:joinpath(".git"):exists() and vim.fn.executable("git") == 1 then
|
if p:joinpath(".git"):exists() and vim.fn.executable("git") == 1 then
|
||||||
|
if vim.fn.has("win32") == 1 then
|
||||||
|
cmd = {
|
||||||
|
"powershell",
|
||||||
|
"-NoProfile",
|
||||||
|
"-NonInteractive",
|
||||||
|
"-Command",
|
||||||
|
string.format(
|
||||||
|
"Push-Location '%s'; (git ls-files --exclude-standard), (git ls-files --exclude-standard --others)",
|
||||||
|
options.directory:gsub("/", "\\")
|
||||||
|
),
|
||||||
|
}
|
||||||
|
else
|
||||||
cmd = {
|
cmd = {
|
||||||
"bash",
|
"bash",
|
||||||
"-c",
|
"-c",
|
||||||
@@ -723,6 +735,7 @@ function M.scan_directory(options)
|
|||||||
options.directory
|
options.directory
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
end
|
||||||
cmd_supports_max_depth = false
|
cmd_supports_max_depth = false
|
||||||
else
|
else
|
||||||
M.error("No search command found")
|
M.error("No search command found")
|
||||||
|
|||||||
Reference in New Issue
Block a user