From e638ed8e0dbf297feedc127e65e95667e9da373c Mon Sep 17 00:00:00 2001 From: William Boman Date: Mon, 24 Mar 2025 22:40:33 +0100 Subject: fix(registry): fix registry.is_installed() --- lua/mason-registry/init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lua') diff --git a/lua/mason-registry/init.lua b/lua/mason-registry/init.lua index bd35f073..b129380c 100644 --- a/lua/mason-registry/init.lua +++ b/lua/mason-registry/init.lua @@ -13,8 +13,8 @@ Registry.aliases = {} ---@param pkg_name string function Registry.is_installed(pkg_name) - local ok, stat = pcall(uv.fs_stat, InstallLocation.global():package(pkg_name), "r", 438) - return ok and stat.type == "directory" + local stat = uv.fs_stat(InstallLocation.global():package(pkg_name)) + return stat ~= nil and stat.type == "directory" end ---Returns an instance of the Package class if the provided package name exists. This function errors if a package -- cgit v1.2.3-70-g09d2