jlj-qmk/util/new_project.sh

28 lines
1.2 KiB
Bash
Raw Normal View History

2015-10-27 18:33:18 +00:00
#!/bin/sh
# Script to make a new quantum project
# Jack Humbert 2015
2016-04-07 22:09:53 +00:00
if [ -z "$1" ]; then
echo "Usage: $0 <keyboard_name>"
2016-04-07 22:09:53 +00:00
exit 1
fi
2015-10-27 18:33:18 +00:00
KEYBOARD=$1
KEYBOARD_UPPERCASE=$(echo $1 | awk '{print toupper($0)}')
mkdir keyboards/$1
mkdir keyboards/$1/keymaps
mkdir keyboards/$1/keymaps/default
sed -e "s;%KEYBOARD%;$KEYBOARD;g" -e "s;%KEYBOARD_UPPERCASE%;$KEYBOARD_UPPERCASE;g" quantum/template/template.h > keyboards/$KEYBOARD/$KEYBOARD.h
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/template.c > keyboards/$KEYBOARD/$KEYBOARD.c
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/config.h > keyboards/$KEYBOARD/config.h
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/README.md > keyboards/$KEYBOARD/README.md
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/Makefile > keyboards/$KEYBOARD/Makefile
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/keymap.c > keyboards/$KEYBOARD/keymaps/default/keymap.c
2015-10-27 18:33:18 +00:00
echo "######################################################"
echo "# keyboards/$KEYBOARD project created. To start"
2015-10-27 18:33:18 +00:00
echo "# working on things, use the following command:"
echo "# cd keyboards/$KEYBOARD"
2016-03-04 15:15:21 +00:00
echo "######################################################"