diff --git a/client/src/addon_manager/models/addon.ts b/client/src/addon_manager/models/addon.ts index 3bb7f7d..383d164 100644 --- a/client/src/addon_manager/models/addon.ts +++ b/client/src/addon_manager/models/addon.ts @@ -278,7 +278,7 @@ export class Addon { )) ?? []) as string[]; const regex = new RegExp( - `[/\\\\]+sumneko.lua[/\\\\]+addonManager[/\\\\]+addons[/\\\\]+${this.name}`, + `addons}?[/\\\\]+${this.name}[/\\\\]+module[/\\\\]+library`, "g" ); const index = librarySetting.findIndex((path) => regex.test(path)); @@ -328,11 +328,18 @@ export class Addon { for (const folder of vscode.workspace.workspaceFolders ?? []) { await this.disable(folder, true); } - const moduleURI = vscode.Uri.joinPath(this.uri, "module"); - await filesystem.deleteFile(moduleURI, { - recursive: true, - useTrash: false, + const files = + (await filesystem.readDirectory( + vscode.Uri.joinPath(this.uri, "module"), + { depth: 1 } + )) ?? []; + files.map((f) => { + return filesystem.deleteFile(f.uri, { + recursive: true, + useTrash: false, + }); }); + await Promise.all(files); localLogger.info(`Uninstalled ${this.name}`); this.#installed = false; this.setLock(false);