Fix promisify-child-process use

Summary: Per title. Somehow both typecheck, but importing the module like this doesn't work.

Reviewed By: jknoxville

Differential Revision: D17285507

fbshipit-source-id: 40a38db5dfb52213e0407f8bda83f2ebad5c50c7
This commit is contained in:
Pascal Hartig
2019-09-10 09:42:22 -07:00
committed by Facebook Github Bot
parent d8cd69666e
commit b19f08ba54
2 changed files with 4 additions and 5 deletions

View File

@@ -8,7 +8,7 @@
import BaseDevice, {DeviceType, DeviceShell, LogLevel} from './BaseDevice'; import BaseDevice, {DeviceType, DeviceShell, LogLevel} from './BaseDevice';
import {Priority} from 'adbkit-logcat-fb'; import {Priority} from 'adbkit-logcat-fb';
import child_process from 'child_process'; import child_process from 'child_process';
import promisify_child_process from 'promisify-child-process'; import {spawn} from 'promisify-child-process';
import ArchivedDevice from './ArchivedDevice'; import ArchivedDevice from './ArchivedDevice';
import {ReadStream} from 'fs'; import {ReadStream} from 'fs';
@@ -82,8 +82,7 @@ export default class AndroidDevice extends BaseDevice {
clearLogs(): Promise<void> { clearLogs(): Promise<void> {
this.logEntries = []; this.logEntries = [];
return promisify_child_process return spawn('adb', ['logcat', '-c'])
.spawn('adb', ['logcat', '-c'])
.then(_ => undefined); .then(_ => undefined);
} }

View File

@@ -5,7 +5,7 @@
* @format * @format
*/ */
import {DeviceType} from '../devices/BaseDevice'; import {DeviceType} from '../devices/BaseDevice';
import promisify_child_process from 'promisify-child-process'; import {exec} from 'promisify-child-process';
import {notNull} from '../utils/typeUtils'; import {notNull} from '../utils/typeUtils';
const errorMessage = 'Physical iOS devices not yet supported'; const errorMessage = 'Physical iOS devices not yet supported';
@@ -21,7 +21,7 @@ function isAvailable(): boolean {
} }
async function targets(): Promise<Array<DeviceTarget>> { async function targets(): Promise<Array<DeviceTarget>> {
const {stdout} = await promisify_child_process.exec('instruments -s devices'); const {stdout} = await exec('instruments -s devices');
if (!stdout) { if (!stdout) {
return []; return [];
} }