From 46f24e4e9d1127c5a917d91028b8d9deb0691bef Mon Sep 17 00:00:00 2001 From: Mehul <65443164+infiniteregrets@users.noreply.github.com> Date: Tue, 21 Nov 2023 11:01:39 -0500 Subject: [PATCH] Check path for binary first (#84) --- changelog.d/62.added.md | 2 +- src/binaryManager.ts | 31 +++++++++++++++---------------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/changelog.d/62.added.md b/changelog.d/62.added.md index a02957b8..fdf45c45 100644 --- a/changelog.d/62.added.md +++ b/changelog.d/62.added.md @@ -1 +1 @@ -Add option to disable auto-update +Add option to disable auto-update. diff --git a/src/binaryManager.ts b/src/binaryManager.ts index d4483319..813b5058 100644 --- a/src/binaryManager.ts +++ b/src/binaryManager.ts @@ -25,22 +25,6 @@ function getExtensionMirrordPath(): Uri { * @returns Path to mirrord binary or null if not found */ export async function getLocalMirrordBinary(version?: string): Promise { - try { - const mirrordPath = getExtensionMirrordPath(); - await workspace.fs.stat(mirrordPath); - if (version) { - const api = new MirrordAPI(mirrordPath.fsPath); - const installedVersion = await api.getBinaryVersion(); - if (installedVersion === version) { - return mirrordPath.fsPath; - } - } else { - return mirrordPath.fsPath; - } - - } catch (e) { - console.log("couldn't find mirrord in extension storage"); - } try { const mirrordPath = await which("mirrord"); if (version) { @@ -59,6 +43,21 @@ export async function getLocalMirrordBinary(version?: string): Promise