Skip to content

Commit

Permalink
fix(bazel): pass correct arguments to http_server in Windows (#30346)
Browse files Browse the repository at this point in the history
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 71eba45
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion integration/bazel/test/e2e/on-prepare.ts
Expand Up @@ -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}`;
Expand Down
Expand Up @@ -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}`;
Expand Down
2 changes: 1 addition & 1 deletion packages/bazel/test/protractor-2/on-prepare.js
Expand Up @@ -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}`;
Expand Down

0 comments on commit 71eba45

Please sign in to comment.