From d720934eeb55b4712987b1a3dae9f4e10c4de83f Mon Sep 17 00:00:00 2001 From: Thomas Tan Date: Fri, 21 Jun 2024 15:39:44 -0700 Subject: [PATCH] fix(powershell) convert "Stop" to 'Stop' and a join parameter to single quotes --- lua/mason-core/managers/powershell/init.lua | 2 +- lua/mason/health.lua | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/mason-core/managers/powershell/init.lua b/lua/mason-core/managers/powershell/init.lua index 0e7f41454..372426e8e 100644 --- a/lua/mason-core/managers/powershell/init.lua +++ b/lua/mason-core/managers/powershell/init.lua @@ -8,7 +8,7 @@ local M = {} local PWSHOPT = { progress_preference = [[ $ProgressPreference = 'SilentlyContinue'; ]], -- https://stackoverflow.com/a/63301751 security_protocol = [[ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ]], - error_action_preference = [[ $ErrorActionPreference = "Stop"; ]], + error_action_preference = [[ $ErrorActionPreference = 'Stop'; ]], } local powershell = _.lazy(function() diff --git a/lua/mason/health.lua b/lua/mason/health.lua index b8680ad4a..8fd27ed9d 100644 --- a/lua/mason/health.lua +++ b/lua/mason/health.lua @@ -155,13 +155,13 @@ local function check_core_utils() if platform.is.win then check { - cmd = "pwsh", + cmd = (vim.fn.executable "pwsh" == 1 and "pwsh" or "powershell"), args = { "-NoProfile", "-Command", - [[$PSVersionTable.PSVersion, $PSVersionTable.OS, $PSVersionTable.Platform -join " "]], + [[$PSVersionTable.PSVersion, $PSVersionTable.OS, $PSVersionTable.Platform -join ' ']], }, - name = "pwsh", + name = (vim.fn.executable "pwsh" == 1 and "pwsh" or "powershell") -- mason switched back to a powershell default } check { cmd = "7z", args = { "--help" }, name = "7z", relaxed = true } end