mirror of
https://github.com/meshtastic/firmware.git
synced 2025-07-30 02:15:41 +00:00
![]() The previous method of removing `--change-mode` from the argument list used a string (`NEW_ARGS`) and `eval set -- $NEW_ARGS` to reconstruct the positional parameters. This was both unsafe and incorrect. Because `NEW_ARGS` was built using quoted literal `$arg` strings instead of the actual values, it resulted in all filtered arguments being set to the same last value of `$arg`. This caused `getopts` to receive incorrect input and silently fail to parse options like `-p` and `-f`, leading to broken behavior and unset variables (e.g., `ESPTOOL_CMD` never got a port). This patch rewrites the logic to use an array (`NEW_ARGS+=("$arg")`), and resets positional parameters via `set -- "${NEW_ARGS[@]}"`. This preserves argument integrity and avoids the unsafe use of `eval`. Example of the broken behavior before this fix: ./device-update.sh -p /dev/ttyACM0 -f firmware.bin Resulted in: set -- firmware.bin firmware.bin firmware.bin firmware.bin Now: set -- -p /dev/ttyACM0 -f firmware.bin as expected. Signed-off-by: Neil Hanlon <neil@shrug.pw> |
||
---|---|---|
.. | ||
bump_metainfo | ||
config.d | ||
generic | ||
.gitignore | ||
99-meshtasticd-udev.rules | ||
base64_to_hex.py | ||
build-esp32.sh | ||
build-firmware.sh | ||
build-native.sh | ||
build-nrf52.sh | ||
build-rp2xx0.sh | ||
build-stm32wl.sh | ||
build-userprefs-json.py | ||
buildinfo.py | ||
bump_version.py | ||
check-all.sh | ||
check-dependencies.sh | ||
config-dist.yaml | ||
device-install_test.ps1 | ||
device-install.bat | ||
device-install.sh | ||
device-update.bat | ||
device-update.sh | ||
dump-ram-users.sh | ||
exception_decoder.py | ||
gen-images.sh | ||
generate_ci_matrix.py | ||
genpartitions.py | ||
lilygo_techo_bootloader-0.6.1.zip | ||
mergehex | ||
Meshtastic_nRF52_factory_erase_v3_S140_6.1.0.uf2 | ||
Meshtastic_nRF52_factory_erase_v3_S140_7.3.0.uf2 | ||
meshtasticd.service | ||
native-gdbserver.sh | ||
native-install.sh | ||
native-run.sh | ||
org.meshtastic.meshtasticd.desktop | ||
org.meshtastic.meshtasticd.metainfo.xml | ||
org.meshtastic.meshtasticd.svg | ||
platformio-custom.py | ||
promote-release.sh | ||
read-system-info.sh | ||
readprops.py | ||
regen-protos.bat | ||
regen-protos.sh | ||
rpkg.macros | ||
s140_nrf52_7.3.0_softdevice.hex | ||
setup-python-for-esp-debug.sh | ||
test-simulator.sh | ||
uf2-convert.bat | ||
uf2conv.py | ||
update-lilygo_techo_bootloader-0.6.1_nosd.uf2 | ||
view-map.sh | ||
web.version | ||
wio_tracker_bootloader_update.bin |