Fix excessive error login for FLIPPER_BROWSER_PORT
Summary: Prior to this diff, an empty env var FLIPPER_BROWSER_PORT resulted in an error Reviewed By: passy Differential Revision: D33712720 fbshipit-source-id: 760fc92bbf44268ec428a3d2947735d5cf8567b7
This commit is contained in:
committed by
Facebook GitHub Bot
parent
76a9b3d3ae
commit
b5cd33f7e8
@@ -63,16 +63,19 @@ export function getServerPortsConfig(): {
|
||||
}
|
||||
}
|
||||
|
||||
const portBrowserOverride = parseEnvironmentVariableAsNumber(
|
||||
let portBrowserOverride: number | undefined;
|
||||
if (process.env.FLIPPER_BROWSER_PORT) {
|
||||
portBrowserOverride = parseEnvironmentVariableAsNumber(
|
||||
'FLIPPER_BROWSER_PORT',
|
||||
);
|
||||
if (portBrowserOverride === undefined) {
|
||||
if (!portBrowserOverride) {
|
||||
console.error(
|
||||
`Ignoring malformed FLIPPER_BROWSER_PORT env variable:
|
||||
"${process.env.FLIPPER_BROWSER_PORT || ''}".
|
||||
Example expected format: "1111".`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
serverPorts: portOverrides ?? {
|
||||
|
||||
Reference in New Issue
Block a user