From d39e46db31c9b2eee458ca59a814ebc4fe8a5bd5 Mon Sep 17 00:00:00 2001 From: William Boman Date: Wed, 14 Sep 2022 17:58:11 +0200 Subject: refactor: store link state in install context object (#419) --- lua/mason-core/installer/context.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lua/mason-core/installer/context.lua') diff --git a/lua/mason-core/installer/context.lua b/lua/mason-core/installer/context.lua index 7d0a505b..50850219 100644 --- a/lua/mason-core/installer/context.lua +++ b/lua/mason-core/installer/context.lua @@ -141,6 +141,7 @@ end ---@field public package Package ---@field public cwd CwdManager ---@field public stdio_sink StdioSink +---@field private bin_links table local InstallContext = {} InstallContext.__index = InstallContext @@ -160,6 +161,7 @@ function InstallContext.new(handle, opts) receipt = receipt.InstallReceiptBuilder.new(), requested_version = Optional.of_nilable(opts.requested_version), stdio_sink = handle.stdio.sink, + bin_links = {}, }, InstallContext) end @@ -310,8 +312,11 @@ function InstallContext:write_shell_exec_wrapper(new_executable_rel_path, comman } end +---@param executable string +---@param rel_path string function InstallContext:link_bin(executable, rel_path) - self.receipt:with_link("bin", executable, rel_path) + self.bin_links[executable] = rel_path + return self end return InstallContext -- cgit v1.2.3-70-g09d2