From 89d7e17c260220e4ac96e03583388af8d652e6b6 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Thu, 26 Aug 2021 04:22:15 -0700 Subject: [PATCH] Fix local CSR lookup Summary: From what I can tell, `idb file pull` seems to behave slightly differently for simulators. When pulling from a remote simulator, it appears to first create a directory for the local destination causing the read in line 508 to as it is trying to read the *folder* `app.csr` not `app.csr/app.csr`. By omitting the destination file name, we avoid this behaviour. Reviewed By: fabiomassimo Differential Revision: D30541778 fbshipit-source-id: 851398aed5fd350a68ba0686707ce0f0aa09672c --- desktop/app/src/server/utils/CertificateProvider.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/desktop/app/src/server/utils/CertificateProvider.tsx b/desktop/app/src/server/utils/CertificateProvider.tsx index db0ec37fe..bca8e739a 100644 --- a/desktop/app/src/server/utils/CertificateProvider.tsx +++ b/desktop/app/src/server/utils/CertificateProvider.tsx @@ -489,13 +489,7 @@ export default class CertificateProvider { return tmpDir({unsafeCleanup: true}) .then((dir) => { return iosUtil - .pull( - deviceId, - originalFile, - bundleId, - path.join(dir, csrFileName), - this.config.idbPath, - ) + .pull(deviceId, originalFile, bundleId, dir, this.config.idbPath) .then(() => dir); }) .then((dir) => { @@ -512,6 +506,7 @@ export default class CertificateProvider { }) .then((fileName) => { const copiedFile = path.resolve(dir, fileName); + console.debug('Trying to read CSR from', copiedFile); return fs .readFile(copiedFile) .then((data) => this.santitizeString(data.toString()));