Skip to content
Permalink
Browse files

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
  • Loading branch information...
alan-agius4 authored and alxhub committed May 9, 2019
1 parent 192f108 commit 71eba450e6d2abc9be65be24bb6b15e12c793887
@@ -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}`;

0 comments on commit 71eba45

Please sign in to comment.
You can’t perform that action at this time.