-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit_zmk.sh
executable file
·41 lines (34 loc) · 998 Bytes
/
init_zmk.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
KEYBOARD_HOME="$(pwd)"
export ZMK_HOME="$KEYBOARD_HOME/zmk"
INIT=false
if [[ ! -d "$ZMK_HOME" ]]
then
INIT=true
echo "Add git sub-modules..."
git submodule add -f https://github.com/tlj/zmk
fi
echo "Update git sub-modules..."
git submodule sync --recursive
git submodule update --init --recursive --progress
echo "Checking out zmk..."
cd $ZMK_HOME
git pull
if [[ "${INIT}" == "true" ]]
then
echo "Initializing West..."
west init -l app/
fi
echo "Updating West..."
west update
west zephyr-export
cd ..
if [[ ! -d "~/.local/zephyr-sdk-0.16.3" ]]
then
brew install cmake ninja gperf python3 ccache qemu dtc wget libmagic
pip3 install -U west
pip3 install -U pyelftools
pip3 install --user --break-system-packages -r zephyr/scripts/requirements-base.txt
curl -L -o ~/Downloads/zephyr.tar.gz https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.15.0/zephyr-sdk-0.15.0_macos-aarch64.tar.gz
tar zxf ~/Downloads/zephyr.tar.gz -C ~/.local/
fi