build.sh: add list and -l to list firmwares available to build.

This commit is contained in:
Thane Gill
2026-02-08 14:49:03 -08:00
parent b1094c2842
commit 3ff1394dd2

View File

@@ -7,6 +7,7 @@ sh build.sh <command> [target]
Commands:
help|usage|-h|--help: Shows this message.
list|-l: List firmwares available to build.
build-firmware <target>: Build the firmware for the given build target.
build-firmwares: Build all firmwares for all targets.
build-matching-firmwares <build-match-spec>: Build all firmwares for build targets containing the string given for <build-match-spec>.
@@ -46,20 +47,24 @@ $ sh build.sh build-firmware RAK_4631_repeater
EOF
}
# get a list of pio env names that start with "env:"
get_pio_envs() {
pio project config | grep 'env:' | sed 's/env://'
}
# Catch cries for help before doing anything else.
case $1 in
help|usage|-h|--help)
global_usage
exit 1
;;
list|-l)
get_pio_envs
exit 0
;;
esac
# get a list of pio env names that start with "env:"
get_pio_envs() {
echo $(pio project config | grep 'env:' | sed 's/env://')
}
# $1 should be the string to find (case insensitive)
get_pio_envs_containing_string() {
shopt -s nocasematch