aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 47a9c88..8995312 100755
--- a/build.sh
+++ b/build.sh
@@ -3,6 +3,7 @@ ZSDK_VERSION=0.13.2
ZEN_BRANCH=Board-Corne-ish-Zen-dedicated-work-queue
CONFIG_DIR=~/waffle_git/zmk-build/config
ZMK_DIR=~/waffle_git/zmk
+UF2=~/*.uf2
update() {
(cd ${ZMK_DIR} ; git pull ; west update)
@@ -12,6 +13,12 @@ update() {
rm zephyr-toolchain-arm-${ZSDK_VERSION}-linux-x86_64-setup.run
}
+test_uf2() {
+ if test -f ${UF2}; then
+ rm ${UF2}
+ fi
+}
+
read -p "update? (y/n) " -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]
then
@@ -26,6 +33,7 @@ do
case $opt in
"corne")
echo "building corne firmware..."
+ test_uf2
(cd ${ZMK_DIR}
if [ $(git branch --show-current) == "${ZEN_BRANCH}"]; then
git checkout main
@@ -41,6 +49,7 @@ do
;;
"corne-ish zen")
echo "building corne-ish zen firmware..."
+ test_uf2
(cd ${ZMK_DIR}
if [[ $(git branch --show-current) = "main" ]]; then
git checkout ${ZEN_BRANCH}
@@ -49,7 +58,7 @@ do
(cd ${ZMK_DIR}/app
west build -p -b corne-ish_zen_left -- -DZMK_CONFIG="${CONFIG_DIR}"
cp ${ZMK_DIR}/app/build/zephyr/zmk.uf2 ~/corne-ish_zen_left.uf2
- west build -p -b corne-ish_zen_left -- -DZMK_CONFIG="${CONFIG_DIR}"
+ west build -p -b corne-ish_zen_right -- -DZMK_CONFIG="${CONFIG_DIR}"
cp ${ZMK_DIR}/app/build/zephyr/zmk.uf2 ~/corne-ish_zen_right.uf2
)
break
@@ -57,6 +66,6 @@ do
"quit")
break
;;
- *) echo "invalid option $REPLY";;
+ *) echo "invalid option: $REPLY";;
esac
done