Skip to content

Commit 3ff1394

Browse files
committed
build.sh: add list and -l to list firmwares available to build.
1 parent b1094c2 commit 3ff1394

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

build.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ sh build.sh <command> [target]
77
88
Commands:
99
help|usage|-h|--help: Shows this message.
10+
list|-l: List firmwares available to build.
1011
build-firmware <target>: Build the firmware for the given build target.
1112
build-firmwares: Build all firmwares for all targets.
1213
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
4647
EOF
4748
}
4849

50+
# get a list of pio env names that start with "env:"
51+
get_pio_envs() {
52+
pio project config | grep 'env:' | sed 's/env://'
53+
}
54+
4955
# Catch cries for help before doing anything else.
5056
case $1 in
5157
help|usage|-h|--help)
5258
global_usage
5359
exit 1
5460
;;
61+
list|-l)
62+
get_pio_envs
63+
exit 0
64+
;;
5565
esac
5666

5767

58-
# get a list of pio env names that start with "env:"
59-
get_pio_envs() {
60-
echo $(pio project config | grep 'env:' | sed 's/env://')
61-
}
62-
6368
# $1 should be the string to find (case insensitive)
6469
get_pio_envs_containing_string() {
6570
shopt -s nocasematch

0 commit comments

Comments
 (0)