ci: test powershell core on Linux

This commit is contained in:
Jan Edmund Lazo
2019-12-31 14:21:57 -05:00
parent e922576bdd
commit 1836853955
3 changed files with 10 additions and 2 deletions

View File

@@ -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'}, ',')..';'