aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/installer/context.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2023-04-26 17:58:27 +0200
committerGitHub <noreply@github.com>2023-04-26 17:58:27 +0200
commit1cb07e4d7bba61a5da9502bb2a6a1d1ff278d5fe (patch)
tree3722db95c89c079fc63e166cdfab26cfab400479 /lua/mason-core/installer/context.lua
parentrefactor(linker): copy_file instead of rename on Windows (#1254) (diff)
downloadmason-1cb07e4d7bba61a5da9502bb2a6a1d1ff278d5fe.tar
mason-1cb07e4d7bba61a5da9502bb2a6a1d1ff278d5fe.tar.gz
mason-1cb07e4d7bba61a5da9502bb2a6a1d1ff278d5fe.tar.bz2
mason-1cb07e4d7bba61a5da9502bb2a6a1d1ff278d5fe.tar.lz
mason-1cb07e4d7bba61a5da9502bb2a6a1d1ff278d5fe.tar.xz
mason-1cb07e4d7bba61a5da9502bb2a6a1d1ff278d5fe.tar.zst
mason-1cb07e4d7bba61a5da9502bb2a6a1d1ff278d5fe.zip
feat(linker): add ruby exec wrapper delegate (#1260)
Diffstat (limited to 'lua/mason-core/installer/context.lua')
-rw-r--r--lua/mason-core/installer/context.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/lua/mason-core/installer/context.lua b/lua/mason-core/installer/context.lua
index 10f6629f..e42393ff 100644
--- a/lua/mason-core/installer/context.lua
+++ b/lua/mason-core/installer/context.lua
@@ -254,6 +254,21 @@ 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 script_rel_path string Relative path to the Node.js script.
+function InstallContext:write_ruby_exec_wrapper(new_executable_rel_path, script_rel_path)
+ if not self.fs:file_exists(script_rel_path) then
+ error(("Cannot write Ruby exec wrapper for path %q as it doesn't exist."):format(script_rel_path), 0)
+ end
+ return self:write_shell_exec_wrapper(
+ new_executable_rel_path,
+ ("ruby %q"):format(path.concat {
+ self.package:get_install_path(),
+ script_rel_path,
+ })
+ )
+end
+
+---@param new_executable_rel_path string Relative path to the executable file to create.
---@param script_rel_path string Relative path to the PHP script.
function InstallContext:write_php_exec_wrapper(new_executable_rel_path, script_rel_path)
if not self.fs:file_exists(script_rel_path) then