]> git.donarmstrong.com Git - qmk_firmware.git/blob - util/new_project.sh
Merge pull request #1212 from Xyverz/master
[qmk_firmware.git] / util / new_project.sh
1 #!/bin/sh
2 # Script to make a new quantum project
3 # Jack Humbert 2015
4
5 if [ -z "$1" ]; then
6         echo "Usage: $0 <keyboard_name>"
7         exit 1
8 fi
9
10 cd "$(dirname "$0")/.."
11
12 KEYBOARD=$1
13 KEYBOARD_UPPERCASE=$(echo $1 | awk '{print toupper($0)}')
14
15 mkdir keyboards/$1
16 mkdir keyboards/$1/keymaps
17 mkdir keyboards/$1/keymaps/default
18 sed -e "s;%KEYBOARD%;$KEYBOARD;g" -e "s;%KEYBOARD_UPPERCASE%;$KEYBOARD_UPPERCASE;g" quantum/template/template.h > keyboards/$KEYBOARD/$KEYBOARD.h
19 sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/template.c > keyboards/$KEYBOARD/$KEYBOARD.c
20 sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/config.h > keyboards/$KEYBOARD/config.h
21 sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/readme.md > keyboards/$KEYBOARD/readme.md
22 sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/Makefile > keyboards/$KEYBOARD/Makefile
23 sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/rules.mk > keyboards/$KEYBOARD/rules.mk
24 sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/config.h > keyboards/$KEYBOARD/keymaps/default/config.h
25 sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/keymap.c > keyboards/$KEYBOARD/keymaps/default/keymap.c
26 sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/Makefile > keyboards/$KEYBOARD/keymaps/default/Makefile
27 sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/readme.md > keyboards/$KEYBOARD/keymaps/default/readme.md
28
29 echo "######################################################"
30 echo "# /keyboards/$KEYBOARD project created. To start"
31 echo "# working on things, cd into keyboards/$KEYBOARD"
32 echo "######################################################"