aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/mason-core/managers/powershell/init.lua38
1 files changed, 17 insertions, 21 deletions
diff --git a/lua/mason-core/managers/powershell/init.lua b/lua/mason-core/managers/powershell/init.lua
index c0d36f2e..5cc5e21d 100644
--- a/lua/mason-core/managers/powershell/init.lua
+++ b/lua/mason-core/managers/powershell/init.lua
@@ -15,19 +15,17 @@ function M.script(script, opts, custom_spawn)
opts = opts or {}
---@type JobSpawn
local spawner = custom_spawn or spawn
- return spawner.powershell(
- vim.tbl_extend("keep", {
- "-NoProfile",
- on_spawn = function(_, stdio)
- local stdin = stdio[1]
- stdin:write(PWSHOPT.progress_preference)
- stdin:write(PWSHOPT.security_protocol)
- stdin:write(script)
- stdin:close()
- end,
- env_raw = process.graft_env(opts.env or {}, { "PSMODULEPATH" }),
- }, opts) --[[@as JobSpawnOpts]]
- )
+ return spawner.powershell(vim.tbl_extend("keep", {
+ "-NoProfile",
+ on_spawn = function(_, stdio)
+ local stdin = stdio[1]
+ stdin:write(PWSHOPT.progress_preference)
+ stdin:write(PWSHOPT.security_protocol)
+ stdin:write(script)
+ stdin:close()
+ end,
+ env_raw = process.graft_env(opts.env or {}, { "PSMODULEPATH" }),
+ }, opts) --[[@as JobSpawnOpts]])
end
---@param command string
@@ -37,14 +35,12 @@ function M.command(command, opts, custom_spawn)
opts = opts or {}
---@type JobSpawn
local spawner = custom_spawn or spawn
- return spawner.powershell(
- vim.tbl_extend("keep", {
- "-NoProfile",
- "-Command",
- PWSHOPT.progress_preference .. PWSHOPT.security_protocol .. command,
- env_raw = process.graft_env(opts.env or {}, { "PSMODULEPATH" }),
- }, opts) --[[@as JobSpawnOpts]]
- )
+ return spawner.powershell(vim.tbl_extend("keep", {
+ "-NoProfile",
+ "-Command",
+ PWSHOPT.progress_preference .. PWSHOPT.security_protocol .. command,
+ env_raw = process.graft_env(opts.env or {}, { "PSMODULEPATH" }),
+ }, opts) --[[@as JobSpawnOpts]])
end
return M