From e13d54a97bb95ec0b0826e13e5886fe9790f04df Mon Sep 17 00:00:00 2001 From: William Boman Date: Sun, 16 Feb 2025 18:51:43 +0100 Subject: feat(context): add ctx:await() --- lua/mason-core/installer/context/init.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lua/mason-core/installer/context/init.lua') diff --git a/lua/mason-core/installer/context/init.lua b/lua/mason-core/installer/context/init.lua index 44490782..b22c562b 100644 --- a/lua/mason-core/installer/context/init.lua +++ b/lua/mason-core/installer/context/init.lua @@ -109,6 +109,12 @@ function InstallContext:chdir(rel_path, fn) end end +---@async +---@param fn fun(resolve: fun(result: any), reject: fun(error: any)) +function InstallContext:await(fn) + return a.wait(fn) +end + ---@param new_executable_rel_path string Relative path to the executable file to create. ---@param script_rel_path string Relative path to the Node.js script. function InstallContext:write_node_exec_wrapper(new_executable_rel_path, script_rel_path) -- cgit v1.2.3-70-g09d2