aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core
diff options
context:
space:
mode:
Diffstat (limited to 'lua/mason-core')
-rw-r--r--lua/mason-core/installer/context.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/lua/mason-core/installer/context.lua b/lua/mason-core/installer/context.lua
index e42393ff..52fbcf16 100644
--- a/lua/mason-core/installer/context.lua
+++ b/lua/mason-core/installer/context.lua
@@ -342,6 +342,9 @@ local BATCH_TEMPLATE = _.dedent [[
---@param env table<string, string>?
---@return string # The created executable filename.
function InstallContext:write_shell_exec_wrapper(new_executable_rel_path, command, env)
+ if self.fs:file_exists(new_executable_rel_path) or self.fs:dir_exists(new_executable_rel_path) then
+ error(("Cannot write exec wrapper to %q because the file already exists."):format(new_executable_rel_path), 0)
+ end
return platform.when {
unix = function()
local std = require "mason-core.managers.std"