qmk_firmware/new_project.sh

27 lines
1.1 KiB
Bash
Raw Normal View History

2015-10-27 19:33:18 +01:00
#!/bin/sh
# Script to make a new quantum project
# Jack Humbert 2015
2016-04-08 00:09:53 +02:00
if [ -z "$1" ]; then
echo "Usege: $0 <keyboard_name>"
exit 1
fi
2015-10-27 19:33:18 +01:00
KEYBOARD=$1
KEYBOARD_UPPERCASE=$(echo $1 | awk '{print toupper($0)}')
mkdir keyboard/$1
mkdir keyboard/$1/keymaps
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
2016-01-24 02:45:52 +01:00
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default.c > keyboard/$KEYBOARD/keymaps/default.c
2015-10-27 19:33:18 +01:00
echo "######################################################"
echo "# keyboard/$KEYBOARD project created. To start"
echo "# working on things, use the following command:"
echo "# cd keyboard/$KEYBOARD"
2016-03-04 16:15:21 +01:00
echo "######################################################"