fix(bazel): pass correct arguments to http_server in Windows (#30346)
Under Windows, the server binary has an extension of `.exe` and the current logic is not handling that. Partially addresses: #29785 PR Close #30346
This commit is contained in:
		
							parent
							
								
									d8665e639b
								
							
						
					
					
						commit
						3aff79c251
					
				| @ -2,7 +2,7 @@ import { browser } from 'protractor'; | ||||
| import {OnPrepareConfig, runServer} from '@angular/bazel/protractor-utils'; | ||||
| 
 | ||||
| export = function(config: OnPrepareConfig) { | ||||
|   const portFlag = config.server.endsWith('prodserver') ? '-p' : '-port'; | ||||
|   const portFlag = /prodserver(\.exe)?$/.test(config.server) ? '-p' : '-port'; | ||||
|   return runServer(config.workspace, config.server, portFlag, []) | ||||
|     .then(serverSpec => { | ||||
|       const serverUrl = `http://localhost:${serverSpec.port}`; | ||||
|  | ||||
| @ -14,7 +14,7 @@ module.exports = function(config) { | ||||
|   // selected port (given a port flag to pass to the server as an argument). | ||||
|   // The port used is returned in serverSpec and the protractor serverUrl | ||||
|   // is the configured. | ||||
|   const portFlag = config.server.endsWith('prodserver') ? '-p' : '-port'; | ||||
|   const portFlag = /prodserver(\.exe)?$/.test(config.server) ? '-p' : '-port'; | ||||
|   return protractorUtils.runServer(config.workspace, config.server, portFlag, []) | ||||
|       .then(serverSpec => { | ||||
|         const serverUrl = `http://localhost:${serverSpec.port}`; | ||||
|  | ||||
| @ -13,7 +13,7 @@ module.exports = function(config) { | ||||
|   if (!global.userOnPrepareGotCalled) { | ||||
|     throw new Error('Expecting user configuration onPrepare to have been called'); | ||||
|   } | ||||
|   const portFlag = config.server.endsWith('prodserver') ? '-p' : '-port'; | ||||
|   const portFlag = /prodserver(\.exe)?$/.test(config.server) ? '-p' : '-port'; | ||||
|   return protractorUtils.runServer(config.workspace, config.server, portFlag, []) | ||||
|       .then(serverSpec => { | ||||
|         const serverUrl = `http://localhost:${serverSpec.port}`; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user