mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 04:01:48 +08:00
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:
parent
1f8c5d6eb2
commit
ec1f75e3a8
@ -57,6 +57,10 @@ async function getCLI(packageJson) {
|
|||||||
configDir: 'SBCONFIG_CONFIG_DIR',
|
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);
|
const port = await getFreePort(program.port);
|
||||||
|
|
||||||
if (!program.ci && !program.smokeTest && program.port != null && port !== program.port) {
|
if (!program.ci && !program.smokeTest && program.port != null && port !== program.port) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user