Replace child-process promise version

Summary:
This one is in TS, so we get types for free.
`promisify` makes it rather awkward to work with overloaded
functions like `spawn`, so there's still value in having
a proper library for this.

Reviewed By: jknoxville

Differential Revision: D17204471

fbshipit-source-id: 3d07edfe2bb8c1e4c4f3134b53a0c4a0d9be383b
This commit is contained in:
Pascal Hartig
2019-09-09 07:03:00 -07:00
committed by Facebook Github Bot
parent 4d7e776672
commit b90200e2aa
3 changed files with 13 additions and 3 deletions

View File

@@ -120,6 +120,7 @@
"openssl-wrapper": "^0.3.4",
"pkg": "^4.3.7",
"promise-retry": "^1.1.1",
"promisify-child-process": "^3.1.1",
"prop-types": "^15.6.0",
"query-string": "^6.2.0",
"react": "16.8.6",

View File

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

View File

@@ -704,7 +704,7 @@
pirates "^4.0.0"
source-map-support "^0.5.9"
"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.4.2", "@babel/runtime@^7.4.5":
"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.1.5", "@babel/runtime@^7.4.2", "@babel/runtime@^7.4.5":
version "7.5.5"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.5.5.tgz#74fba56d35efbeca444091c7850ccd494fd2f132"
integrity sha512-28QvEGyQyNkB0/m2B4FU7IEZGK2NUrcMtT6BZEFALTguLk+AUT6ofsHtPk5QyjAdUkpMJ+/Em+quwz4HOt30AQ==
@@ -6970,6 +6970,13 @@ promise@^7.1.1:
dependencies:
asap "~2.0.3"
promisify-child-process@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/promisify-child-process/-/promisify-child-process-3.1.1.tgz#3a029c1d97bdb8bbcc8862c765b91f1cee0f2691"
integrity sha512-683UHZEP4Bm75BvBujEe87AdE9lxnoWpcU5pEw4FG9HCSwwZC9pF7HUj3QmlDAvhyvulkWHLZs1lVRBNTvkbXQ==
dependencies:
"@babel/runtime" "^7.1.5"
prompts@^2.0.1:
version "2.1.0"
resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.1.0.tgz#bf90bc71f6065d255ea2bdc0fe6520485c1b45db"