bump @pybricks/firmware to 5.0.0

This contains a breaking change where main.py is now optional so we
have to handle that case.
This commit is contained in:
David Lechner
2022-07-20 18:01:35 -05:00
parent 1d2c55eba6
commit 709c3c554b
3 changed files with 13 additions and 7 deletions
+7 -1
View File
@@ -201,11 +201,17 @@ function* loadFirmware(
const firmwareBase = yield* call(() => reader.readFirmwareBase());
const metadata = yield* call(() => reader.readMetadata());
// if a user program was not given, then use main.py from the frimware.zip
// if a user program was not given, then use main.py from the firmware.zip
if (program === undefined) {
program = yield* call(() => reader.readMainPy());
}
// REVISIT: the firmware may eventually be changed to allow no main.py
// for now, ensure there is a program even if it does nothing
if (!program) {
program = '';
}
if (![5, 6].includes(metadata['mpy-abi-version'])) {
yield* put(
didFailToFinish(