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

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

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