Skip to content

Commit 1d58092

Browse files
committed
fix: add toolchain integrity check to prevent partial extraction issues
1 parent 08e089b commit 1d58092

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ BUILD_OUTPUT_FILE="output/F3.bin"
1414

1515
# --- 1. Conditional Download and Extraction ---
1616

17-
if [ ! -d "$TOOLCHAIN_DIR" ]; then
18-
echo "Toolchain directory '$TOOLCHAIN_DIR' not found."
17+
if [ ! -d "$TOOLCHAIN_DIR" ] || [ ! -f "$TOOLCHAIN_DIR/bin/arm-none-eabi-gcc" ]; then
18+
echo "Toolchain directory '$TOOLCHAIN_DIR' or required binary not found."
1919

2020
# 1a. Detect Operating System
2121
OS=""
@@ -49,7 +49,7 @@ if [ ! -d "$TOOLCHAIN_DIR" ]; then
4949

5050
echo "Download and extraction of $TOOLCHAIN_DIR completed successfully."
5151
else
52-
echo "Toolchain directory '$TOOLCHAIN_DIR' already exists. Skipping download and extraction."
52+
echo "Toolchain directory '$TOOLCHAIN_DIR' and required binary found. Skipping download and extraction."
5353
fi
5454

5555

0 commit comments

Comments
 (0)