Skip to content

Commit c132306

Browse files
committed
move *up* arch check to ensure that unsupported arches get aborted early.
This avoids notifying when the machine is unsupported. This is prefered behavior by *at least* @vendion
1 parent a9bf829 commit c132306

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

lua/tabnine/binary.lua

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ local function binary_name()
3838
end
3939

4040
local function binary_path()
41+
local machine = arch_and_platform()
42+
if not machine then
43+
return nil -- Is this machine supported?
44+
end
45+
4146
local paths = vim.tbl_map(function(path)
4247
return fn.fnamemodify(path, ":t")
4348
end, fn.glob(binaries_path .. "/*", true, true))
@@ -53,10 +58,6 @@ local function binary_path()
5358
vim.notify("Did you remember to run the build script for tabnine-nvim?", vim.log.levels.WARN)
5459
return nil -- Is it installed?
5560
end
56-
local machine = arch_and_platform()
57-
if not machine then
58-
return nil -- Is this machine supported?
59-
end
6061
local binary = binaries_path .. "/" .. tostring(version) .. "/" .. machine .. "/" .. binary_name()
6162

6263
if vim.fn.filereadable(binary) then -- Double check that it's installed

0 commit comments

Comments
 (0)