Skip to content

Commit d720934

Browse files
committed
fix(powershell) convert "Stop" to 'Stop' and a join parameter to single quotes
1 parent 0950b15 commit d720934

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lua/mason-core/managers/powershell/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ local M = {}
88
local PWSHOPT = {
99
progress_preference = [[ $ProgressPreference = 'SilentlyContinue'; ]], -- https://stackoverflow.com/a/63301751
1010
security_protocol = [[ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ]],
11-
error_action_preference = [[ $ErrorActionPreference = "Stop"; ]],
11+
error_action_preference = [[ $ErrorActionPreference = 'Stop'; ]],
1212
}
1313

1414
local powershell = _.lazy(function()

lua/mason/health.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,13 @@ local function check_core_utils()
155155

156156
if platform.is.win then
157157
check {
158-
cmd = "pwsh",
158+
cmd = (vim.fn.executable "pwsh" == 1 and "pwsh" or "powershell"),
159159
args = {
160160
"-NoProfile",
161161
"-Command",
162-
[[$PSVersionTable.PSVersion, $PSVersionTable.OS, $PSVersionTable.Platform -join " "]],
162+
[[$PSVersionTable.PSVersion, $PSVersionTable.OS, $PSVersionTable.Platform -join ' ']],
163163
},
164-
name = "pwsh",
164+
name = (vim.fn.executable "pwsh" == 1 and "pwsh" or "powershell") -- mason switched back to a powershell default
165165
}
166166
check { cmd = "7z", args = { "--help" }, name = "7z", relaxed = true }
167167
end

0 commit comments

Comments
 (0)