aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-08-13 14:35:12 +0200
committerGitHub <noreply@github.com>2022-08-13 14:35:12 +0200
commitcb7bdcd2d5a71ffb12127d60bcaad5ba39ab741b (patch)
tree113873de7a647cd4ba3a092c6f54fd5ffa61ccdb /lua/mason-core
parentchore: update generated code (#291) (diff)
downloadmason-cb7bdcd2d5a71ffb12127d60bcaad5ba39ab741b.tar
mason-cb7bdcd2d5a71ffb12127d60bcaad5ba39ab741b.tar.gz
mason-cb7bdcd2d5a71ffb12127d60bcaad5ba39ab741b.tar.bz2
mason-cb7bdcd2d5a71ffb12127d60bcaad5ba39ab741b.tar.lz
mason-cb7bdcd2d5a71ffb12127d60bcaad5ba39ab741b.tar.xz
mason-cb7bdcd2d5a71ffb12127d60bcaad5ba39ab741b.tar.zst
mason-cb7bdcd2d5a71ffb12127d60bcaad5ba39ab741b.zip
fix(julia-lsp): adjust for changes in latest release (#289)
Diffstat (limited to 'lua/mason-core')
-rw-r--r--lua/mason-core/installer/context.lua30
1 files changed, 14 insertions, 16 deletions
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<string, string>?
@@ -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,
}