Fix: Avoid false-negative checks for port

When a port is provided via env vars, we're usually told
by the CLI that it's unavailable, only to be suggested the
same port next.
This commit is contained in:
Lochlan Bunn 2019-02-13 10:07:23 +10:00
parent 1f8c5d6eb2
commit ec1f75e3a8

View File

@ -57,6 +57,10 @@ async function getCLI(packageJson) {
configDir: 'SBCONFIG_CONFIG_DIR',
});
if (typeof program.port === 'string' && program.port.length > 0) {
program.port = parseInt(program.port, 10);
}
const port = await getFreePort(program.port);
if (!program.ci && !program.smokeTest && program.port != null && port !== program.port) {