From 8cbc370b1f99a5dac3f5df97b04a8aa36b979ed4 Mon Sep 17 00:00:00 2001 From: William Boman Date: Mon, 3 Mar 2025 16:08:13 +0100 Subject: fix(uninstaller): only unlink if recipt is found --- lua/mason-core/installer/UninstallRunner.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/mason-core/installer/UninstallRunner.lua b/lua/mason-core/installer/UninstallRunner.lua index 661bfefa..67ae285f 100644 --- a/lua/mason-core/installer/UninstallRunner.lua +++ b/lua/mason-core/installer/UninstallRunner.lua @@ -44,8 +44,9 @@ function UninstallRunner:execute(opts, callback) local receipt = pkg:get_receipt(location):or_else(nil) if receipt == nil then log.fmt_warn("Receipt not found when uninstalling %s", pkg) + else + try(pkg:unlink(location)) end - try(pkg:unlink(location)) fs.sync.rmrf(location:package(pkg.name)) return receipt end):get_or_throw() -- cgit v1.2.3-70-g09d2