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.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/lua/mason-core/installer/context.lua b/lua/mason-core/installer/context.lua
index dd9b9617..132cc064 100644
--- a/lua/mason-core/installer/context.lua
+++ b/lua/mason-core/installer/context.lua
@@ -67,6 +67,12 @@ function ContextualFs:write_file(rel_path, contents)
end
---@async
+---@param rel_path string The relative path from the current working directory to the file to read.
+function ContextualFs:read_file(rel_path)
+ return fs.async.read_file(path.concat { self.cwd:get(), rel_path })
+end
+
+---@async
---@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 })