Skip to content

Commit fff7cad

Browse files
Update key into unzip dir
1 parent 81ba244 commit fff7cad

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kernel/src/services/FirmwareService.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,10 @@ export class FirmwareService {
214214
const firmwareData = await this.unzipStreamToVariable(result.body!);
215215

216216
// The firmware file is a zipped file containing the necessary 'micropython.bin' file
217-
const firmwareDataMP = firmwareData[`${selectedFirmware.name}/micropython.bin`];
217+
// let's remove the .zip extension from the name and use it as the key to access the firmware data.
218+
const fileKey = selectedFirmware.name.replace('.zip', '') + '/micropython.bin';
219+
console.log('File key:', fileKey);
220+
const firmwareDataMP = firmwareData[fileKey];
218221

219222
this.firmwareString = Array.from(firmwareDataMP)
220223
.map(byte => String.fromCharCode(byte))

0 commit comments

Comments
 (0)