From 8bbecdf2e7da08660ab22005394e591a984eb149 Mon Sep 17 00:00:00 2001 From: Eren Atas Date: Sun, 5 May 2024 15:12:01 +0200 Subject: [PATCH] add local build script --- .gitignore | 1 + build-locally.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .gitignore create mode 100755 build-locally.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d163863 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/ \ No newline at end of file diff --git a/build-locally.sh b/build-locally.sh new file mode 100755 index 0000000..5335552 --- /dev/null +++ b/build-locally.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +set -euxo pipefail + +# Requirements: +# 1. https://zmk.dev/docs/development/setup +# 2. checkout zmk repo to feat/pointers-move-scroll on petejohansson's repo + +build_and_copy () { + local side=$1 + west build \ + -b nice_nano_v2 -- \ + -DSHIELD=charybdis_$side \ + -DZMK_CONFIG="/home/erenatas/GitRepos/zmk-config-charybdis-mini-wireless/config" + + cp "./build/zephyr/zmk.uf2" "$CURRENT_DIR/build/charybdis_$side.uf2" +} + +CURRENT_DIR="$(pwd)" +CONFIG_DIR="$(pwd)/config" + +DEFAULTZMKAPPDIR="$HOME/GitRepos/zmk/app" +ZMK_APP_DIR="${1:-$DEFAULTZMKAPPDIR}" + +mkdir -p $CURRENT_DIR/build + +pushd $ZMK_APP_DIR + +build_and_copy left +build_and_copy right + +popd +