#!/bin/bash
bindir=FactoryTest/build/esp32.esp32.m5stack_stickc_plus2
mkdir -p "$bindir"
baseurl="https://cit.istlab.info/f/FactoryTest.ino."
echo "Downloading FactoryTest firmware files..."
for ext in bin bootloader.bin partitions.bin; do
url="${baseurl}${ext}"
echo "Downloading $url ..."
curl -L -o "$bindir/FactoryTest.ino.${ext}" "$url"
if [ $? -ne 0 ]; then
echo "Failed to download $url"
exit 1
fi
done