Use configurable idb installation path

Summary:
Part of https://github.com/facebook/flipper/issues/262

Use the user-configured idb install location instead of a hardcoded one.

Reviewed By: passy

Differential Revision: D21860236

fbshipit-source-id: 5c604d7b6361e7c93ab49d8a03a437dfce880ac1
This commit is contained in:
John Knox
2020-06-04 03:01:18 -07:00
committed by Facebook GitHub Bot
parent 17763809dd
commit ec6310dc3b
3 changed files with 45 additions and 40 deletions

View File

@@ -78,6 +78,7 @@ export default class CertificateProvider {
logger: Logger;
adb: Promise<ADBClient>;
certificateSetup: Promise<void>;
store: Store;
server: Server;
constructor(server: Server, logger: Logger, store: Store) {
@@ -87,6 +88,7 @@ export default class CertificateProvider {
this.ensureServerCertExists(),
'ensureServerCertExists',
);
this.store = store;
this.server = server;
}
@@ -261,7 +263,13 @@ export default class CertificateProvider {
return tmpDir({unsafeCleanup: true}).then((dir) => {
const filePath = path.resolve(dir, filename);
promisify(fs.writeFile)(filePath, contents).then(() =>
iosUtil.push(udid, filePath, bundleId, destination),
iosUtil.push(
udid,
filePath,
bundleId,
destination,
this.store.getState().settingsState.idbPath,
),
);
});
}
@@ -386,7 +394,13 @@ export default class CertificateProvider {
return tmpDir({unsafeCleanup: true})
.then((dir) => {
return iosUtil
.pull(deviceId, originalFile, bundleId, path.join(dir, csrFileName))
.pull(
deviceId,
originalFile,
bundleId,
path.join(dir, csrFileName),
this.store.getState().settingsState.idbPath,
)
.then(() => dir);
})
.then((dir) => {