mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 08:02:38 +00:00
ci: test powershell core on Linux
This commit is contained in:
@@ -115,9 +115,12 @@ jobs:
|
|||||||
apt:
|
apt:
|
||||||
sources:
|
sources:
|
||||||
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
- sourceline: 'ppa:ubuntu-toolchain-r/test'
|
||||||
|
- sourceline: 'deb [arch=amd64] https://packages.microsoft.com/ubuntu/16.04/prod xenial main'
|
||||||
|
key_url: 'https://packages.microsoft.com/keys/microsoft.asc'
|
||||||
packages:
|
packages:
|
||||||
- *common-apt-packages
|
- *common-apt-packages
|
||||||
- gcc-9
|
- gcc-9
|
||||||
|
- powershell
|
||||||
- if: branch = master AND commit_message !~ /\[skip.lint\]/
|
- if: branch = master AND commit_message !~ /\[skip.lint\]/
|
||||||
name: lint
|
name: lint
|
||||||
os: linux
|
os: linux
|
||||||
|
|||||||
@@ -504,9 +504,13 @@ function module.source(code)
|
|||||||
return fname
|
return fname
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function module.has_powershell()
|
||||||
|
return module.eval('executable("'..(iswin() and 'powershell' or 'pwsh')..'")') == 1
|
||||||
|
end
|
||||||
|
|
||||||
function module.set_shell_powershell()
|
function module.set_shell_powershell()
|
||||||
local shell = iswin() and 'powershell' or 'pwsh'
|
local shell = iswin() and 'powershell' or 'pwsh'
|
||||||
assert(module.eval('executable("'..shell..'")'))
|
assert(module.has_powershell())
|
||||||
local cmd = 'Remove-Item -Force '..table.concat(iswin()
|
local cmd = 'Remove-Item -Force '..table.concat(iswin()
|
||||||
and {'alias:cat', 'alias:echo', 'alias:sleep'}
|
and {'alias:cat', 'alias:echo', 'alias:sleep'}
|
||||||
or {'alias:echo'}, ',')..';'
|
or {'alias:echo'}, ',')..';'
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ local iswin = helpers.iswin
|
|||||||
local clear = helpers.clear
|
local clear = helpers.clear
|
||||||
local command = helpers.command
|
local command = helpers.command
|
||||||
local nvim_dir = helpers.nvim_dir
|
local nvim_dir = helpers.nvim_dir
|
||||||
|
local has_powershell = helpers.has_powershell
|
||||||
local set_shell_powershell = helpers.set_shell_powershell
|
local set_shell_powershell = helpers.set_shell_powershell
|
||||||
|
|
||||||
describe("shell command :!", function()
|
describe("shell command :!", function()
|
||||||
@@ -228,7 +229,7 @@ describe("shell command :!", function()
|
|||||||
]])
|
]])
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
if iswin() or eval('executable("pwsh")') == 1 then
|
if has_powershell() then
|
||||||
it('powershell supports literal strings', function()
|
it('powershell supports literal strings', function()
|
||||||
set_shell_powershell()
|
set_shell_powershell()
|
||||||
local screen = Screen.new(30, 4)
|
local screen = Screen.new(30, 4)
|
||||||
|
|||||||
Reference in New Issue
Block a user