Skip to content

Commit 40bde48

Browse files
authored
Merge pull request #38 from mirsella/main
feat(xdg spec): use $XDG_DATA_HOME by default
2 parents 074a83a + 37f53c7 commit 40bde48

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lua/supermaven-nvim/binary/binary_fetcher.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,14 @@ end
134134

135135
function BinaryFetcher:local_binary_parent_path()
136136
local home_dir = self.homedir
137-
return home_dir .. "/.supermaven/binary/v15/" .. self:platform() .. "-" .. self:get_arch()
137+
local data_dir = os.getenv("XDG_DATA_HOME")
138+
local dir
139+
if data_dir then
140+
dir = data_dir .. "/supermaven"
141+
else
142+
dir = home_dir .. "/.supermaven"
143+
end
144+
return dir .. "/binary/v15/" .. self:platform() .. "-" .. self:get_arch()
138145
end
139146

140147
return BinaryFetcher

0 commit comments

Comments
 (0)