aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/installer/linker.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2023-10-11 15:33:10 +0200
committerWilliam Boman <william@redwill.se>2025-02-16 09:49:17 +0100
commit40bb6ddfa84b91f58a53f9d92ce7a3ce0c57b9aa (patch)
tree1c092b13b2c40c693db87f040410411977990cef /lua/mason-core/installer/linker.lua
parentfix(package): support older receipt structures (#1520) (diff)
downloadmason-40bb6ddfa84b91f58a53f9d92ce7a3ce0c57b9aa.tar
mason-40bb6ddfa84b91f58a53f9d92ce7a3ce0c57b9aa.tar.gz
mason-40bb6ddfa84b91f58a53f9d92ce7a3ce0c57b9aa.tar.bz2
mason-40bb6ddfa84b91f58a53f9d92ce7a3ce0c57b9aa.tar.lz
mason-40bb6ddfa84b91f58a53f9d92ce7a3ce0c57b9aa.tar.xz
mason-40bb6ddfa84b91f58a53f9d92ce7a3ce0c57b9aa.tar.zst
mason-40bb6ddfa84b91f58a53f9d92ce7a3ce0c57b9aa.zip
refactor(receipt): change receipt structure and remove old builder APIs (#1521)
Diffstat (limited to 'lua/mason-core/installer/linker.lua')
-rw-r--r--lua/mason-core/installer/linker.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/lua/mason-core/installer/linker.lua b/lua/mason-core/installer/linker.lua
index 7a1098fb..83b1f4a5 100644
--- a/lua/mason-core/installer/linker.lua
+++ b/lua/mason-core/installer/linker.lua
@@ -21,12 +21,12 @@ local LinkContext = {
---@param link_context LinkContext
local function unlink(receipt, link_context)
return Result.pcall(function()
- local links = receipt.links[link_context.type]
+ local links = receipt:get_links()[link_context.type]
if not links then
return
end
for linked_file in pairs(links) do
- if receipt.schema_version == "1.0" and link_context == LinkContext.BIN and platform.is.win then
+ if receipt:get_schema_version() == "1.0" and link_context == LinkContext.BIN and platform.is.win then
linked_file = linked_file .. ".cmd"
end
local share_path = link_context.prefix(linked_file)
@@ -39,7 +39,7 @@ end
---@param receipt InstallReceipt
---@nodiscard
function M.unlink(pkg, receipt)
- log.fmt_debug("Unlinking %s", pkg, receipt.links)
+ log.fmt_debug("Unlinking %s", pkg, receipt:get_links())
return Result.try(function(try)
try(unlink(receipt, LinkContext.BIN))
try(unlink(receipt, LinkContext.SHARE))