From d54b3411920f6094c2df3cd1edec6b022aaa9aed Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 23 Oct 2019 05:50:19 -0700 Subject: [PATCH] Upgrade which / simplify use Summary: It's already a promise. With the next upgrade this otherwise causes some nasty type errors due to overloading. Reviewed By: jknoxville Differential Revision: D18059641 fbshipit-source-id: 93cee95d7bbf767ff6276a0946262bf83587c728 --- package.json | 2 +- src/chrome/DevicesButton.tsx | 5 +---- yarn.lock | 8 ++++---- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 70b52ad20..2a302bdc6 100644 --- a/package.json +++ b/package.json @@ -114,7 +114,7 @@ "@types/redux-devtools-extension": "^2.13.2", "@types/redux-mock-store": "^1.0.1", "@types/rsocket-tcp-server": "^0.0.2", - "@types/which": "^1.3.1", + "@types/which": "^1.3.2", "JSONStream": "^1.3.1", "adbkit": "^2.11.1", "adbkit-logcat": "^2.0.1", diff --git a/src/chrome/DevicesButton.tsx b/src/chrome/DevicesButton.tsx index 7aca66df5..75594ed80 100644 --- a/src/chrome/DevicesButton.tsx +++ b/src/chrome/DevicesButton.tsx @@ -13,15 +13,12 @@ import {spawn} from 'child_process'; import {dirname} from 'path'; import {selectDevice, preferDevice} from '../reducers/connections'; import {default as which} from 'which'; -import {promisify} from 'util'; import {showOpenDialog} from '../utils/exportData'; import PropTypes from 'prop-types'; import BaseDevice from '../devices/BaseDevice'; import React, {Component} from 'react'; import {State} from '../reducers'; -const whichPromise = promisify(which); - type StateFromProps = { selectedDevice: BaseDevice | null | undefined; androidEmulators: Array; @@ -48,7 +45,7 @@ class DevicesButton extends Component { launchEmulator = (name: string) => { // On Linux, you must run the emulator from the directory it's in because // reasons ... - whichPromise('emulator') + which('emulator') .then(emulatorPath => { if (emulatorPath) { const child = spawn(emulatorPath, [`@${name}`], { diff --git a/yarn.lock b/yarn.lock index 237eab1db..72d43280b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1460,10 +1460,10 @@ dependencies: "@types/node" "*" -"@types/which@^1.3.1": - version "1.3.1" - resolved "https://registry.yarnpkg.com/@types/which/-/which-1.3.1.tgz#7802c380887986ca909008afea4e08025b130f8d" - integrity sha512-ZrJDWpvg75LTGX4XwuneY9s6bF3OeZcGTpoGh3zDV9ytzcHMFsRrMIaLBRJZQMBoGyKs6unBQfVdrLZiYfb1zQ== +"@types/which@^1.3.2": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@types/which/-/which-1.3.2.tgz#9c246fc0c93ded311c8512df2891fb41f6227fdf" + integrity sha512-8oDqyLC7eD4HM307boe2QWKyuzdzWBj56xI/imSl2cpL+U3tCMaTAkMJ4ee5JBZ/FsOJlvRGeIShiZDAl1qERA== "@types/yargs-parser@*": version "13.1.0"