Strictify adbConfig

Summary: As per title

Reviewed By: passy

Differential Revision: D17285741

fbshipit-source-id: 8d2693c09d5dfa6d71cb6aedbb0504d09200f4ac
This commit is contained in:
Pritesh Nandgaonkar
2019-09-11 05:25:48 -07:00
committed by Facebook Github Bot
parent 6df299425e
commit a35fd7389f

View File

@@ -6,7 +6,13 @@
*/ */
export default () => { export default () => {
let port = parseInt(process.env.ANDROID_ADB_SERVER_PORT, 10) || 5037; const serverPortString = process.env.ANDROID_ADB_SERVER_PORT;
let port = 5037;
if (serverPortString) {
const parsedInt = parseInt(serverPortString, 10);
port = isNaN(parsedInt) ? port : parsedInt;
}
let host = 'localhost'; let host = 'localhost';
const socket = (process.env.ADB_SERVER_SOCKET || '').trim(); const socket = (process.env.ADB_SERVER_SOCKET || '').trim();