fix(cache): fix loading libs on Darwin

This commit is contained in:
Folke Lemaitre 2023-03-20 08:01:30 +01:00
parent b306eb3d0f
commit 236f8517ba
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 2 additions and 1 deletions

View File

@ -176,7 +176,8 @@ end
---@private
function Loader.loader_lib(modname)
local start = uv.hrtime()
local is_win = uv.os_uname().sysname:lower():find("win", 1, true)
local sysname = uv.os_uname().sysname:lower() or ""
local is_win = sysname:find("win", 1, true) and not sysname:find("darwin", 1, true)
local ret = M.find(modname, { patterns = is_win and { ".dll" } or { ".so" } })[1]
---@type function?, string?
if ret then