Migrate adbClient
Summary: Per title. Eliminated an attempt to catch an error which never actually worked, but flow couldn't work out how `promisify` works. Reviewed By: danielbuechele Differential Revision: D16708932 fbshipit-source-id: c1e98afd671ffd9bd8be25222366870ddf849ce3
This commit is contained in:
committed by
Facebook Github Bot
parent
2e1dc7d40d
commit
cf7e692620
@@ -19,7 +19,7 @@ const tmpFile = promisify(tmp.file);
|
||||
const tmpDir = promisify(tmp.dir);
|
||||
import iosUtil from '../fb-stubs/iOSContainerUtility.tsx';
|
||||
import {reportPlatformFailures} from './metrics';
|
||||
import {getAdbClient} from './adbClient';
|
||||
import {getAdbClient} from './adbClient.tsx';
|
||||
import * as androidUtil from './androidContainerUtility';
|
||||
|
||||
// Desktop file paths
|
||||
|
||||
@@ -28,15 +28,9 @@ function createClient() {
|
||||
? `${process.env.ANDROID_HOME}/platform-tools/adb`
|
||||
: 'adb';
|
||||
return reportPlatformFailures(
|
||||
promisify(child_process.exec)(`${adbPath} start-server`)
|
||||
.then(result => {
|
||||
if (result.error) {
|
||||
throw new Error(
|
||||
`Failed to start adb server: ${result.stderr.toString()}`,
|
||||
);
|
||||
}
|
||||
})
|
||||
.then(() => adbkit.createClient(adbConfig())),
|
||||
promisify(child_process.exec)(`${adbPath} start-server`).then(() =>
|
||||
adbkit.createClient(adbConfig()),
|
||||
),
|
||||
'createADBClient.shell',
|
||||
).catch(err => {
|
||||
console.error(
|
||||
@@ -10,7 +10,7 @@
|
||||
* opaque types will ensure the commands are only ever run on validated
|
||||
* arguments.
|
||||
*/
|
||||
import {getAdbClient} from './adbClient';
|
||||
import {getAdbClient} from './adbClient.tsx';
|
||||
import {UnsupportedError} from './metrics';
|
||||
const adbkit = require('adbkit-fb');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user