From c73c772c03724ba2a28298644c49fa9cdb659a3c Mon Sep 17 00:00:00 2001 From: Jason Horrocks Date: Fri, 13 Feb 2026 12:48:15 -0800 Subject: [PATCH 1/3] Only run mergebin on valid targets --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 095a1633..32255949 100755 --- a/build.sh +++ b/build.sh @@ -53,7 +53,8 @@ build_firmware() { pio run -e $1 # build merge-bin for esp32 fresh install - if [ -f .pio/build/$1/firmware.bin ]; then + # only when "mergebin" is in targets + if pio run --list-targets -e $1 | grep mergebin; then pio run -t mergebin -e $1 fi From add8376bd1a7aed83bab14b732a85d3e56d67801 Mon Sep 17 00:00:00 2001 From: Jason Horrocks Date: Fri, 13 Feb 2026 12:52:09 -0800 Subject: [PATCH 2/3] Stricter matching of project build env names "extends = env:Xiao_nrf52_repeater" is erroneously added before fix. --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 32255949..0ffa90f4 100755 --- a/build.sh +++ b/build.sh @@ -9,7 +9,7 @@ # get a list of pio env names that start with "env:" get_pio_envs() { - echo $(pio project config | grep 'env:' | sed 's/env://') + echo $(pio project config | grep '^env:' | sed 's/env://') } # $1 should be the string to find (case insensitive) From bda97ffb97a54c3003eda1b2f777252e7b8a087c Mon Sep 17 00:00:00 2001 From: Jason Horrocks Date: Sun, 15 Feb 2026 13:22:39 -0800 Subject: [PATCH 3/3] Call python3 and fall back to python if needed. The uf2 script requires Python 3, but the executable may be 'python' on some systems. --- build.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 0ffa90f4..a51f455a 100755 --- a/build.sh +++ b/build.sh @@ -60,7 +60,11 @@ build_firmware() { # build .uf2 for nrf52 boards if [[ -f .pio/build/$1/firmware.zip && -f .pio/build/$1/firmware.hex ]]; then - python bin/uf2conv/uf2conv.py .pio/build/$1/firmware.hex -c -o .pio/build/$1/firmware.uf2 -f 0xADA52840 + if python3 -V ; then + python3 bin/uf2conv/uf2conv.py .pio/build/$1/firmware.hex -c -o .pio/build/$1/firmware.uf2 -f 0xADA52840 + else # fall back to python command (may be needed on windows) + python bin/uf2conv/uf2conv.py .pio/build/$1/firmware.hex -c -o .pio/build/$1/firmware.uf2 -f 0xADA52840 + fi fi # copy .bin, .uf2, and .zip to out folder