Skip to content

Commit

Permalink
move *up* arch check to ensure that unsupported arches get aborted ea…
Browse files Browse the repository at this point in the history
…rly.

This avoids notifying when the machine is unsupported.
This is prefered behavior by *at least* @vendion
  • Loading branch information
aarondill committed Jan 12, 2024
1 parent a9bf829 commit c132306
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lua/tabnine/binary.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ local function binary_name()
end

local function binary_path()
local machine = arch_and_platform()
if not machine then
return nil -- Is this machine supported?
end

local paths = vim.tbl_map(function(path)
return fn.fnamemodify(path, ":t")
end, fn.glob(binaries_path .. "/*", true, true))
Expand All @@ -53,10 +58,6 @@ local function binary_path()
vim.notify("Did you remember to run the build script for tabnine-nvim?", vim.log.levels.WARN)
return nil -- Is it installed?
end
local machine = arch_and_platform()
if not machine then
return nil -- Is this machine supported?
end
local binary = binaries_path .. "/" .. tostring(version) .. "/" .. machine .. "/" .. binary_name()

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

0 comments on commit c132306

Please sign in to comment.