Add one more fallback for the adb path
Summary: It seems that adb path has changed on the jest-e2e side. That might case the flipper e2e test failure. With this fallback we have granular control of the path. Reviewed By: antonk52 Differential Revision: D46278512 fbshipit-source-id: 97310459de54eeb003eefb3a3ff06af8b13bebae
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ff6b0043c4
commit
53a5939d68
@@ -51,12 +51,20 @@ async function startAdbServer(androidHome: string) {
|
|||||||
const adbPath = path.resolve(androidHome, 'platform-tools', 'adb');
|
const adbPath = path.resolve(androidHome, 'platform-tools', 'adb');
|
||||||
const args = ['start-server'];
|
const args = ['start-server'];
|
||||||
|
|
||||||
return execFile(adbPath, args).catch((error) => {
|
return execFile(adbPath, args)
|
||||||
if (error.code == 'ENOENT') {
|
.catch((error) => {
|
||||||
console.info('falling back to the alternative adb path');
|
if (error.code == 'ENOENT') {
|
||||||
return execFile(path.resolve(androidHome, 'adb'), args);
|
console.info('falling back to the alternative adb path');
|
||||||
}
|
return execFile(path.resolve(androidHome, 'adb'), args);
|
||||||
|
}
|
||||||
|
throw error;
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
if (error.code == 'ENOENT') {
|
||||||
|
console.info('falling back to the adb path of last resort');
|
||||||
|
return execFile(androidHome, args);
|
||||||
|
}
|
||||||
|
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user