Files
2026-05-29 18:24:00 +02:00

33 lines
550 B
Bash
Executable File

#!/bin/bash
files=(
"code.py"
"boot.py"
"src"
"lib"
)
# find mountpoint
target="$(findmnt -rn -S LABEL=CIRCUITPY -o TARGET)/"
echo "attemting to write to ${target}"
read -p "Continue? [y/N] " confirm
[[ "$confirm" == [yY] ]] || exit 1
# Flash
if [ -d "${target}" ]; then
for file in "${files[@]}"; do
echo -n "$file "
# delete old version
rm "${target}${file}" -r
# copy new version over
cp "./${file}" "${target}" -r
done
else
echo "Board not mounted!"
fi
echo "-> done!"