forked from meshcore-dev/MeshCore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·60 lines (53 loc) · 1.42 KB
/
Copy pathbuild.sh
File metadata and controls
executable file
·60 lines (53 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
set -euo pipefail
readonly SUPPORTED_TARGETS=(
heltec_v4_repeater
heltec_v4_solar_repeater
heltec_v4_solar_repeater_headless
heltec_v4_expansionkit_repeater
heltec_v4_repeater_bridge_espnow
heltec_v4_repeater_bridge_espnow_low_power
heltec_v4_room_server
heltec_v4_terminal_chat
heltec_v4_companion_radio_usb
heltec_v4_companion_radio_ble
heltec_v4_companion_radio_ble_low_power
heltec_v4_companion_radio_wifi
heltec_v4_companion_radio_wifi_low_power
heltec_v4_sensor
heltec_v4_sensor_low_power
heltec_v4_kiss_modem
)
if ! command -v pio >/dev/null 2>&1; then
echo "error: PlatformIO is not installed or 'pio' is not in PATH" >&2
echo "install it with: python -m pip install --upgrade platformio" >&2
exit 1
fi
is_supported_target() {
local candidate="$1"
local supported
for supported in "${SUPPORTED_TARGETS[@]}"; do
[[ "$candidate" == "$supported" ]] && return 0
done
return 1
}
if (( $# > 0 )); then
targets=("$@")
else
targets=("${SUPPORTED_TARGETS[@]}")
fi
for target in "${targets[@]}"; do
if ! is_supported_target "$target"; then
echo "error: unsupported target '$target'" >&2
echo "supported Heltec V4 targets:" >&2
printf ' %s\n' "${SUPPORTED_TARGETS[@]}" >&2
exit 2
fi
done
for target in "${targets[@]}"; do
echo
echo "==> Building ${target}"
pio run -e "$target"
done
echo
echo "All requested Heltec V4 builds completed successfully."