mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 08:18:17 +00:00
Merge #11642 'CI: test powershell core'
This commit is contained in:
@@ -504,9 +504,13 @@ function module.source(code)
|
||||
return fname
|
||||
end
|
||||
|
||||
function module.has_powershell()
|
||||
return module.eval('executable("'..(iswin() and 'powershell' or 'pwsh')..'")') == 1
|
||||
end
|
||||
|
||||
function module.set_shell_powershell()
|
||||
local shell = iswin() and 'powershell' or 'pwsh'
|
||||
assert(module.eval('executable("'..shell..'")'))
|
||||
assert(module.has_powershell())
|
||||
local cmd = 'Remove-Item -Force '..table.concat(iswin()
|
||||
and {'alias:cat', 'alias:echo', 'alias:sleep'}
|
||||
or {'alias:echo'}, ',')..';'
|
||||
|
@@ -10,6 +10,7 @@ local iswin = helpers.iswin
|
||||
local clear = helpers.clear
|
||||
local command = helpers.command
|
||||
local nvim_dir = helpers.nvim_dir
|
||||
local has_powershell = helpers.has_powershell
|
||||
local set_shell_powershell = helpers.set_shell_powershell
|
||||
|
||||
describe("shell command :!", function()
|
||||
@@ -228,7 +229,7 @@ describe("shell command :!", function()
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
if iswin() or eval('executable("pwsh")') == 1 then
|
||||
if has_powershell() then
|
||||
it('powershell supports literal strings', function()
|
||||
set_shell_powershell()
|
||||
local screen = Screen.new(30, 4)
|
||||
|
Reference in New Issue
Block a user