zmk-config/build-env/flash

18 lines
297 B
Plaintext
Raw Normal View History

2022-03-01 19:38:13 -06:00
#!/usr/bin/env bash
set -e
DEVICE=$1
SIDE=$2
if [ "$SIDE" != "left" ] && [ "$SIDE" != "right" ]; then
echo "Usage: ./flash device side"
echo " eg: ./flash /dev/sdb right"
exit 1
fi
sudo mount "$DEVICE" /mnt/usb
sudo cp "out/corne_$SIDE.uf2" /mnt/usb
sudo sync
sudo umount /mnt/usb