Add docker/qmk/compile_firmware.sh

This commit is contained in:
colin 2024-02-29 00:29:34 +00:00
parent d833c24464
commit f22075c732
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
#!/bin/bash
# Navigate to the QMK firmware directory
cd qmk_firmware
# Update submodules
make git-submodule
# Compile each keyboard and keymap found in the /usr/src/app/data directory
# This is a simple example; you might need to adjust it based on your requirements
for d in /usr/src/app/data/* ; do
if [ -d "$d" ]; then
kb=$(basename "$d")
for km in "$d"/* ; do
if [ -d "$km" ]; then
keymap=$(basename "$km")
echo "Compiling $kb with keymap $keymap..."
make "$kb:$keymap"
# Copy the compiled firmware to the bin directory
cp .build/*_$keymap.hex /usr/src/app/bin/
fi
done
fi
done