-
Notifications
You must be signed in to change notification settings - Fork 12
/
init_qmk.sh
executable file
·43 lines (40 loc) · 1.2 KB
/
init_qmk.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
41
42
43
#!/bin/bash
KEYBOARD_HOME="$(pwd)"
export QMK_HOME="$KEYBOARD_HOME/qmk_firmware"
USER_SPACE="$QMK_HOME/users"
HANDWIRED="keyboards/handwired"
BM40="keyboards/kprepublic/bm40hsrgb/keymaps"
MJ64="keyboards/melgeek/mj64/keymaps"
if [[ ! -d "$QMK_HOME" ]]
then
echo "Add git sub-modules..."
git submodule add -f https://github.com/qmk/qmk_firmware
fi
echo "Update git sub-modules..."
git submodule sync --recursive
git submodule update --init --recursive --progress
if [[ ! -d "$USER_SPACE/rafaelromao" ]]
then
echo "Creating userspace symbolic link..."
ln -s "$KEYBOARD_HOME/src/qmk/users/rafaelromao" "$USER_SPACE"
fi
if [[ ! -d "$QMK_HOME/$HANDWIRED/rafaelromao" ]]
then
echo "Creating Handwired symbolic link..."
ln -s "$KEYBOARD_HOME/src/qmk/$HANDWIRED/rafaelromao" "$QMK_HOME/$HANDWIRED"
fi
if [[ ! -d "$QMK_HOME/$BM40/rafaelromao" ]]
then
echo "Creating BM40 symbolic link..."
ln -s "$KEYBOARD_HOME/src/qmk/$BM40/rafaelromao" "$QMK_HOME/$BM40"
fi
if [[ ! -d "$QMK_HOME/$MJ64/clopes.le" ]]
then
echo "Creating MJ64 symbolic link..."
ln -s "$KEYBOARD_HOME/src/qmk/$MJ64/clopes.le" "$QMK_HOME/$MJ64"
fi
echo "Checking out qmk v0.21.3..."
cd $QMK_HOME
git fetch
git checkout 0.21.3
cd ..