-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathBuildESP32ResourceFile.sh
38 lines (29 loc) · 1.03 KB
/
BuildESP32ResourceFile.sh
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
#!/bin/bash
echo "Building Xedge32 resource file main/BAS/examples/xedge/obj/XedgeZip.c"
directories=("main/BAS" "main/BAS-Resources" "main/lua-protobuf")
for dir in "${directories[@]}"; do
if [ ! -d "$dir" ]; then
echo "Directory '$dir' does not exist."
echo "Please make sure you cloned the repository recursively."
exit 1
fi
done
mkdir -p main/BAS/examples/xedge/obj || exit 1
export BIN2C=main/BAS-Resources/tools/linux/bin2c
#Resource build directory
RB=main/BAS-Resources/build
pushd $RB || exit 1
chmod +x Xedge.sh
echo "Running $PWD/Xedge.sh"
export NO_BIN2C=1
./Xedge.sh || exit 1
popd
echo "Adding ESP32 modules"
if [ "$NO_FWUPDATE" == "1" ]; then
zip -D -r -9 $RB/Xedge.zip .lua -x ".lua/XedgePlugins/fw*" || exit 1
else
zip -d main/BAS-Resources/build/Xedge.zip ".lua/XedgePlugins/appupdate.*"
zip -D -r -9 $RB/Xedge.zip .lua || exit 1
fi
$BIN2C -z getLspZipReader $RB/Xedge.zip main/BAS/examples/xedge/obj/XedgeZip.c || exit 1
echo "Created: main/BAS/examples/xedge/obj/XedgeZip.c"