Skip to content

Commit 12ddd18

Browse files
fix(powershell): conform to single quotes (#1740)
Co-authored-by: William Boman <william@redwill.se>
1 parent cf8f0f8 commit 12ddd18

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

lua/mason-core/installer/managers/powershell.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: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,15 @@ local function check_core_utils()
113113
end
114114

115115
if platform.is.win then
116+
local powershell = vim.fn.executable "pwsh" == 1 and "pwsh" or "powershell"
116117
check {
117-
cmd = "pwsh",
118+
cmd = powershell,
118119
args = {
119120
"-NoProfile",
120121
"-Command",
121-
[[$PSVersionTable.PSVersion, $PSVersionTable.OS, $PSVersionTable.Platform -join " "]],
122+
[[$PSVersionTable.PSVersion, $PSVersionTable.OS, $PSVersionTable.Platform -join ' ']],
122123
},
123-
name = "pwsh",
124+
name = powershell,
124125
}
125126
check { cmd = "7z", args = { "--help" }, name = "7z", relaxed = true }
126127
end

tests/mason-core/installer/managers/powershell_spec.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ describe("powershell manager", function()
6969
"-NoProfile",
7070
"-NonInteractive",
7171
"-Command",
72-
[[ $ErrorActionPreference = "Stop"; $ProgressPreference = 'SilentlyContinue'; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; echo 'Is this bash?']],
72+
[[ $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; echo 'Is this bash?']],
7373
})
7474
end)
7575

0 commit comments

Comments
 (0)