mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	Merge #11642 'CI: test powershell core'
This commit is contained in:
		| @@ -86,6 +86,8 @@ addons: | ||||
|       - xclip | ||||
|   homebrew: | ||||
|     update: false | ||||
|     casks: | ||||
|       - powershell | ||||
|     packages: | ||||
|       - ccache | ||||
|       - ninja | ||||
| @@ -115,9 +117,12 @@ jobs: | ||||
|         apt: | ||||
|           sources: | ||||
|             - 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: | ||||
|             - *common-apt-packages | ||||
|             - gcc-9 | ||||
|             - powershell | ||||
|     - if: branch = master AND commit_message !~ /\[skip.lint\]/ | ||||
|       name: lint | ||||
|       os: linux | ||||
|   | ||||
| @@ -17,12 +17,12 @@ build_nvim | ||||
|  | ||||
| exit_suite --continue | ||||
|  | ||||
| enter_suite tests | ||||
|  | ||||
| source ~/.nvm/nvm.sh | ||||
| nvm use 10 | ||||
| export TREE_SITTER_DIR=$HOME/tree-sitter-build/ | ||||
|  | ||||
| enter_suite tests | ||||
|  | ||||
| if test "$CLANG_SANITIZER" != "TSAN" ; then | ||||
|   # Additional threads are only created when the builtin UI starts, which | ||||
|   # doesn't happen in the unit/functional tests | ||||
|   | ||||
| @@ -5202,8 +5202,9 @@ A jump table for the options with a short description can be found at |Q_op|. | ||||
| 	Note that such processing is done after |:set| did its own round of  | ||||
| 	unescaping, so to keep yourself sane use |:let-&| like shown above. | ||||
| 							*shell-powershell* | ||||
| 	To use powershell (on Windows): > | ||||
| 		set shell=powershell shellquote= shellpipe=\| shellxquote= | ||||
| 	To use powershell: > | ||||
| 		let &shell = has('win32') ? 'powershell' : 'pwsh' | ||||
| 		set shellquote= shellpipe=\| shellxquote= | ||||
| 		set shellcmdflag=-NoLogo\ -NoProfile\ -ExecutionPolicy\ RemoteSigned\ -Command | ||||
| 		set shellredir=\|\ Out-File\ -Encoding\ UTF8 | ||||
|  | ||||
|   | ||||
| @@ -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
	 Justin M. Keyes
					Justin M. Keyes