aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/installer/context.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/mason-core/installer/context.lua')
-rw-r--r--lua/mason-core/installer/context.lua30
1 files changed, 15 insertions, 15 deletions
diff --git a/lua/mason-core/installer/context.lua b/lua/mason-core/installer/context.lua
index 3e701d8e..a3577cfa 100644
--- a/lua/mason-core/installer/context.lua
+++ b/lua/mason-core/installer/context.lua
@@ -53,39 +53,39 @@ function ContextualFs.new(cwd)
end
---@async
----@param rel_path string @The relative path from the current working directory to the file to append.
+---@param rel_path string: The relative path from the current working directory to the file to append.
---@param contents string
function ContextualFs:append_file(rel_path, contents)
return fs.async.append_file(path.concat { self.cwd:get(), rel_path }, contents)
end
---@async
----@param rel_path string @The relative path from the current working directory to the file to write.
+---@param rel_path string: The relative path from the current working directory to the file to write.
---@param contents string
function ContextualFs:write_file(rel_path, contents)
return fs.async.write_file(path.concat { self.cwd:get(), rel_path }, contents)
end
---@async
----@param rel_path string @The relative path from the current working directory.
+---@param rel_path string: The relative path from the current working directory.
function ContextualFs:file_exists(rel_path)
return fs.async.file_exists(path.concat { self.cwd:get(), rel_path })
end
---@async
----@param rel_path string @The relative path from the current working directory.
+---@param rel_path string: The relative path from the current working directory.
function ContextualFs:dir_exists(rel_path)
return fs.async.dir_exists(path.concat { self.cwd:get(), rel_path })
end
---@async
----@param rel_path string @The relative path from the current working directory.
+---@param rel_path string: The relative path from the current working directory.
function ContextualFs:rmrf(rel_path)
return fs.async.rmrf(path.concat { self.cwd:get(), rel_path })
end
---@async
----@param rel_path string @The relative path from the current working directory.
+---@param rel_path string: The relative path from the current working directory.
function ContextualFs:unlink(rel_path)
return fs.async.unlink(path.concat { self.cwd:get(), rel_path })
end
@@ -104,7 +104,7 @@ function ContextualFs:mkdir(dirpath)
end
---@class CwdManager
----@field private install_prefix string @Defines the upper boundary for which paths are allowed as cwd.
+---@field private install_prefix string: Defines the upper boundary for which paths are allowed as cwd.
---@field private cwd string
local CwdManager = {}
CwdManager.__index = CwdManager
@@ -185,8 +185,8 @@ function InstallContext:promote_cwd()
self.cwd:set(install_path)
end
----@param rel_path string @The relative path from the current working directory to change cwd to. Will only restore to the initial cwd after execution of fn (if provided).
----@param fn async fun() @(optional) The function to run in the context of the given path.
+---@param rel_path string: The relative path from the current working directory to change cwd to. Will only restore to the initial cwd after execution of fn (if provided).
+---@param fn async (fun()): (optional) The function to run in the context of the given path.
function InstallContext:chdir(rel_path, fn)
local old_cwd = self.cwd:get()
self.cwd:set(path.concat { old_cwd, rel_path })
@@ -200,8 +200,8 @@ function InstallContext:chdir(rel_path, fn)
end
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.
+---@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)
return self:write_shell_exec_wrapper(
new_executable_rel_path,
@@ -212,7 +212,7 @@ function InstallContext:write_node_exec_wrapper(new_executable_rel_path, script_
)
end
----@param new_executable_rel_path string @Relative path to the executable file to create.
+---@param new_executable_rel_path string: Relative path to the executable file to create.
---@param target_executable_rel_path string
function InstallContext:write_exec_wrapper(new_executable_rel_path, target_executable_rel_path)
return self:write_shell_exec_wrapper(
@@ -224,9 +224,9 @@ function InstallContext:write_exec_wrapper(new_executable_rel_path, target_execu
)
end
----@param new_executable_rel_path string @Relative path to the executable file to create.
----@param command string @The shell command to run.
----@return string @The created executable filename.
+---@param new_executable_rel_path string: Relative path to the executable file to create.
+---@param command string: The shell command to run.
+---@return string: The created executable filename.
function InstallContext:write_shell_exec_wrapper(new_executable_rel_path, command)
return platform.when {
unix = function()