We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 996194e commit 535ebb5Copy full SHA for 535ebb5
1 file changed
lua/copilot/lsp_binary.lua
@@ -14,21 +14,9 @@ local M = {
14
}
15
16
local function ensure_directory_exists(path)
17
- local dir_path = path
18
- local cmd
19
-
20
- if dir_path and vim.fn.isdirectory(dir_path) == 0 then
21
- if vim.fn.has("win32") > 0 then
22
- cmd = 'cmd /c "mkdir "' .. dir_path:gsub("\\", "\\\\"):gsub("/", "\\\\")
23
- else
24
- cmd = "mkdir " .. vim.fn.shellescape(dir_path)
25
- end
26
27
- logger.trace("Creating directory with command: " .. cmd)
28
- vim.fn.system(cmd)
29
30
- if vim.v.shell_error ~= 0 then
31
- logger.error("Failed to create directory: " .. dir_path)
+ if path and vim.fn.isdirectory(path) == 0 then
+ if vim.fn.mkdir(path) == 0 then
+ logger.error("failed to create directory: " .. path)
32
return false
33
end
34
0 commit comments