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: Commands:
help|usage|-h|--help: Shows this message. 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-firmware <target>: Build the firmware for the given build target.
build-firmwares: Build all firmwares for all targets. 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>. 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 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. # Catch cries for help before doing anything else.
case $1 in case $1 in
help|usage|-h|--help) help|usage|-h|--help)
global_usage global_usage
exit 1 exit 1
;; ;;
list|-l)
get_pio_envs
exit 0
;;
esac 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) # $1 should be the string to find (case insensitive)
get_pio_envs_containing_string() { get_pio_envs_containing_string() {
shopt -s nocasematch shopt -s nocasematch