aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2024-02-25 15:46:55 -0700
committerJack Sangdahl <[email protected]>2024-02-25 15:46:55 -0700
commit5144b1e7cb4ce6cad597231287db2706900f45b7 (patch)
tree5603fa629adca8d03d97b10ff7d55a3ea23f2649 /build.sh
parentd8353f5b4c5c8c5f28c9a81506f91ff3092cae0b (diff)
downloadzmk_build-5144b1e7cb4ce6cad597231287db2706900f45b7.tar.gz
zmk_build-5144b1e7cb4ce6cad597231287db2706900f45b7.zip
fixup revxlp
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh30
1 files changed, 16 insertions, 14 deletions
diff --git a/build.sh b/build.sh
index 1633b15..416cd21 100755
--- a/build.sh
+++ b/build.sh
@@ -1,35 +1,37 @@
#!/bin/sh
-ZMK_DIR=~/waffle_git/zmk
+ZMK_DIR=~/git/zmk
RED=$(tput setaf 1)
-YELLOW=$(tput setaf 3)
GREEN=$(tput setaf 2)
+YELLOW=$(tput setaf 3)
BLUE=$(tput setaf 4)
BOLD=$(tput bold)
NORMAL=$(tput sgr0)
source $ZMK_DIR/.venv/bin/activate
+set -e
build() {
- printf "building $GREEN$1$NORMAL for $BLUE$2$NORMAL...\n"
+ printf "building ${GREEN}$1${NORMAL} for ${BLUE}$2${NORMAL}...\n"
(cd $ZMK_DIR/app
west build -p always -b $2 -- -DSHIELD=$1 \
- -DZMK_CONFIG="$HOME/waffle_git/zmk-build/config" \
- &> /dev/null
+ -DZMK_CONFIG="$HOME/waffle_git/zmk-build/config"
- read -p "${BOLD}flash? (y/n) $NORMAL" yn
+ read -p "${BOLD}flash? (y/n) ${NORMAL}" yn
case $yn in
[Yy]*)
- printf "${YELLOW}enter bootloader$NORMAL...\n"
+ printf "${YELLOW}enter bootloader${NORMAL}...\n"
sleep 5
- west flash
+ doas mount /dev/sdb ~/.local/Media
+ west flash &> /dev/nul
+ doas umount /dev/sdb
;;
[Nn]*) cp build/zephyr/zmk.uf2 ~/$1.uf2 ;;
- * ) printf "${RED}invalid entry$NORMAL\n" ;;
+ * ) printf "${RED}invalid entry${NORMAL}\n" ;;
esac
)
- printf "${GREEN}complete$NORMAL\n"
+ printf "${GREEN}complete${NORMAL}\n"
}
-printf "${BOLD}firmware to build...$NORMAL\n"
+printf "${BOLD}firmware to build${NORMAL}...\n"
printf "(1) corne\t(2) revxlp\t(3) sweep\t(4) settings reset:\t"
read opt;
case $opt in
@@ -48,16 +50,16 @@ case $opt in
build splitkb_aurora_sweep_right nice_nano_v2
;;
4)
- printf "${BOLD}select microcontroller...$NORMAL\n"
+ printf "${BOLD}select microcontroller${NORMAL}...\n"
printf "(1) nice nano\t(2) nice nano v2\t(3) xiao ble:\t"
read val;
case $val in
1) MCU="nice_nano" ;;
2) MCU="nice_nano_v2" ;;
3) MCU="seeeduino_xiao_ble" ;;
- *) printf "${RED}invalid entry$NORMAL\n" ;;
+ *) printf "${RED}invalid entry${NORMAL}\n" ;;
esac
build settings_reset $MCU
;;
- *) printf "${RED}invalid entry$NORMAL\n" ;;
+ *) printf "${RED}invalid entry${NORMAL}\n" ;;
esac