summaryrefslogtreecommitdiff
path: root/util/new_project.sh
blob: b85bbc31cfbecfb7054fc8d705abb4bc2abac77c (plain)
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
#!/bin/sh
# Script to make a new quantum project
# Jack Humbert 2015

if [ -z "$1" ]; then
	echo "Usage: $0 <keyboard_name>"
	exit 1
fi

KEYBOARD=$1
KEYBOARD_UPPERCASE=$(echo $1 | awk '{print toupper($0)}')

mkdir keyboard/$1
mkdir keyboard/$1/keymaps
mkdir keyboard/$1/keymaps/default
sed -e "s;%KEYBOARD%;$KEYBOARD;g" -e "s;%KEYBOARD_UPPERCASE%;$KEYBOARD_UPPERCASE;g" quantum/template/template.h > keyboard/$KEYBOARD/$KEYBOARD.h
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/template.c > keyboard/$KEYBOARD/$KEYBOARD.c
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/config.h > keyboard/$KEYBOARD/config.h
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/README.md > keyboard/$KEYBOARD/README.md
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/Makefile > keyboard/$KEYBOARD/Makefile
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/keymap.c > keyboard/$KEYBOARD/keymaps/default/keymap.c

echo "######################################################"
echo "# keyboard/$KEYBOARD project created. To start"
echo "# working on things, use the following command:"
echo "# cd keyboard/$KEYBOARD"
echo "######################################################"