fix(copilot): Prioritize xdg_config for OAuth token references on Windows (#1037)

This commit is contained in:
hat0uma 2025-01-05 21:45:25 +09:00 committed by GitHub
parent 48fc35f978
commit 0536c6e552
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -104,8 +104,10 @@ H.get_oauth_token = function()
---@type string ---@type string
local config_dir local config_dir
if vim.tbl_contains({ "linux", "darwin" }, os_name) then if xdg_config and vim.fn.isdirectory(xdg_config) > 0 then
config_dir = (xdg_config and vim.fn.isdirectory(xdg_config) > 0) and xdg_config or vim.fn.expand("~/.config") config_dir = xdg_config
elseif vim.tbl_contains({ "linux", "darwin" }, os_name) then
config_dir = vim.fn.expand("~/.config")
else else
config_dir = vim.fn.expand("~/AppData/Local") config_dir = vim.fn.expand("~/AppData/Local")
end end