diff --git a/package.json b/package.json index e3399ac..76d7b6c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ztimson/zim-utils", - "version": "0.4.10", + "version": "0.4.11", "description": "Native, dependency-light ZIM archive reader/searcher and Kiwix catalog downloader for Node.js", "author": "Zak Timson", "license": "MIT", diff --git a/src/manager.js b/src/manager.js index aa85d50..c8cdb73 100644 --- a/src/manager.js +++ b/src/manager.js @@ -142,6 +142,7 @@ export class ZimManager { const match = local.find(l => l.name === nameOrFile || l.href === nameOrFile); if (!match) throw new Error(`ZIM not found locally: ${nameOrFile}`); const file = match.href + (match.href.endsWith('.zim') ? '' : '.zim'); + await this.#server.stop(); await fs.promises.rm(path.join(this.#dir, file), {force: true}); await this.#ensureServer(); await this.#waitUntilVisible(file, {expect: false});