From 8ae17a1ef980779aab2ffd1ddb5cb9fc31680bd5 Mon Sep 17 00:00:00 2001 From: Chris Ward Date: Fri, 19 May 2023 14:24:38 -0500 Subject: [PATCH] Update to handle non Adafruit supplied libraries --- src/librarymanager/libraryManager.ts | 30 ++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/librarymanager/libraryManager.ts b/src/librarymanager/libraryManager.ts index a61f5a4..14e24e3 100644 --- a/src/librarymanager/libraryManager.ts +++ b/src/librarymanager/libraryManager.ts @@ -23,17 +23,27 @@ class LibraryQP implements vscode.QuickPickItem { public constructor(b: Library, p: Library) { this.bundleLib = b; this.projectLib = p; - this.label = b.name; - - if(p === null) { - this.op = "install"; - this.description = `Install version ${b.version}`; - } else if(b.version !== p.version) { - this.op = "update"; - this.description = `Update from v${p.version} to v${b.version}`; + if(b === undefined) { + this.op = "custom"; + if(p === null) { + this.label = "Custom"; + this.description = "Cannot update"; + } else { + this.label = p.name; + this.description = `v${p.version} is a custom library. Not updateable`; + } } else { - this.op = null; - this.description = `v${p.version} is installed and up to date.`; + this.label = b.name; + if(p === null) { + this.op = "install"; + this.description = `Install version ${b.version}`; + } else if(b.version !== p.version) { + this.op = "update"; + this.description = `Update from v${p.version} to v${b.version}`; + } else { + this.op = null; + this.description = `v${p.version} is installed and up to date.`; + } } }