diff --git a/src/app/services/python-uploader/mip/PackageManager.ts b/src/app/services/python-uploader/mip/PackageManager.ts index 7c60c85f..7294b9b7 100644 --- a/src/app/services/python-uploader/mip/PackageManager.ts +++ b/src/app/services/python-uploader/mip/PackageManager.ts @@ -51,11 +51,13 @@ export class PackageManager { if (!url) { throw new Error('No url provided'); } else if (url.startsWith('github:')) { - const writer = this.serialPort.writable.getWriter(); - const reader = this.serialPort.readable.getReader(); + let writer = this.serialPort.writable.getWriter(); + let reader = this.serialPort.readable.getReader(); try { await mkdir(writer, reader, '/lib'); } catch (error) {} + writer.releaseLock(); + reader.releaseLock(); let json = JSON.parse(await PackageManager.fetchMipUrl(url)); const version = json['version']; if (await this.checkLibraryVersion(version, PackageManager.getLibraryName(url))) { @@ -69,6 +71,8 @@ export class PackageManager { content.push({name: '/lib/' + file[0], content: response}); } + writer = this.serialPort.writable.getWriter(); + reader = this.serialPort.readable.getReader(); // get a list of .dist-info files in the lib folder and delete them const response = await ls(writer, reader, '/lib'); // get a list of all the .dist-info folders