From cb7bdcd2d5a71ffb12127d60bcaad5ba39ab741b Mon Sep 17 00:00:00 2001 From: William Boman Date: Sat, 13 Aug 2022 14:35:12 +0200 Subject: fix(julia-lsp): adjust for changes in latest release (#289) --- lua/mason-core/installer/context.lua | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (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 89226f94..b3801330 100644 --- a/lua/mason-core/installer/context.lua +++ b/lua/mason-core/installer/context.lua @@ -239,6 +239,18 @@ function InstallContext:write_exec_wrapper(new_executable_rel_path, target_execu ) end +local BASH_TEMPLATE = _.dedent [[ +#!/bin/bash +%s +exec %s "$@" +]] + +local BATCH_TEMPLATE = _.dedent [[ +@ECHO off +%s +%s %%* +]] + ---@param new_executable_rel_path string: Relative path to the executable file to create. ---@param command string: The shell command to run. ---@param env table? @@ -252,14 +264,7 @@ function InstallContext:write_shell_exec_wrapper(new_executable_rel_path, comman return ("export %s=%q"):format(var, value) end, _.to_pairs(env or {})) - self.fs:write_file( - new_executable_rel_path, - _.dedent(([[ - #!/bin/bash - %s - exec %s "$@" - ]]):format(_.join("\n", formatted_envs), command)) - ) + self.fs:write_file(new_executable_rel_path, BASH_TEMPLATE:format(_.join("\n", formatted_envs), command)) std.chmod("+x", { new_executable_rel_path }) return new_executable_rel_path end, @@ -270,14 +275,7 @@ function InstallContext:write_shell_exec_wrapper(new_executable_rel_path, comman return ("SET %s=%s"):format(var, value) end, _.to_pairs(env or {})) - self.fs:write_file( - executable_file, - _.dedent(([[ - @ECHO off - %s - %s %%* - ]]):format(_.join("\n", formatted_envs), command)) - ) + self.fs:write_file(executable_file, BATCH_TEMPLATE:format(_.join("\n", formatted_envs), command)) return executable_file end, } -- cgit v1.2.3-70-g09d2