Skip to content

Commit 79d0989

Browse files
authored
Merge pull request #962 from haxwithaxe/dev
Added more polished build.sh usage
2 parents f085a9d + 006af52 commit 79d0989

File tree

1 file changed

+40
-7
lines changed

1 file changed

+40
-7
lines changed

build.sh

Lines changed: 40 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,45 @@
11
#!/usr/bin/env bash
22

3-
# usage
4-
# sh build.sh build-firmware RAK_4631_Repeater
5-
# sh build.sh build-firmwares
6-
# sh build.sh build-matching-firmwares RAK_4631
7-
# sh build.sh build-companion-firmwares
8-
# sh build.sh build-repeater-firmwares
9-
# sh build.sh build-room-server-firmwares
3+
global_usage() {
4+
cat - <<EOF
5+
Usage:
6+
sh build.sh <command> [target]
7+
8+
Commands:
9+
help|usage|-h|--help: Shows this message.
10+
build-firmware <target>: Build the firmware for the given build target.
11+
build-firmwares: Build all firmwares for all targets.
12+
build-matching-firmwares <build-match-spec>: Build all firmwares for build targets containing the string given for <build-match-spec>.
13+
build-companion-firmwares: Build all companion firmwares for all build targets.
14+
build-repeater-firmwares: Build all repeater firmwares for all build targets.
15+
build-room-server-firmwares: Build all chat room server firmwares for all build targets.
16+
17+
Examples:
18+
Build firmware for the "RAK_4631_Repeater" device target
19+
$ sh build.sh build-firmware RAK_4631_Repeater
20+
21+
Build all firmwares for device targets containing the string "RAK_4631"
22+
$ sh build.sh build-matching-firmwares <build-match-spec>
23+
24+
Build all companion firmwares
25+
$ sh build.sh build-companion-firmwares
26+
27+
Build all repeater firmwares
28+
$ sh build.sh build-repeater-firmwares
29+
30+
Build all chat room server firmwares
31+
$ sh build.sh build-room-server-firmwares
32+
EOF
33+
}
34+
35+
# Catch cries for help before doing anything else.
36+
case $1 in
37+
help|usage|-h|--help)
38+
global_usage
39+
exit 1
40+
;;
41+
esac
42+
1043

1144
# get a list of pio env names that start with "env:"
1245
get_pio_envs() {

0 commit comments

Comments
 (0)