Make new_project.sh a bit more robust
This commit is contained in:
parent
9a91b42e92
commit
d837ab586a
1 changed files with 5 additions and 13 deletions
|
@ -12,19 +12,11 @@ cd "$(dirname "$0")/.."
|
||||||
KEYBOARD=$1
|
KEYBOARD=$1
|
||||||
KEYBOARD_UPPERCASE=$(echo $1 | awk '{print toupper($0)}')
|
KEYBOARD_UPPERCASE=$(echo $1 | awk '{print toupper($0)}')
|
||||||
|
|
||||||
mkdir keyboards/$1
|
cp -r quantum/template keyboards/$KEYBOARD
|
||||||
mkdir keyboards/$1/keymaps
|
mv keyboards/$KEYBOARD/template.c keyboards/$KEYBOARD/$KEYBOARD.c
|
||||||
mkdir keyboards/$1/keymaps/default
|
mv keyboards/$KEYBOARD/template.h keyboards/$KEYBOARD/$KEYBOARD.h
|
||||||
sed -e "s;%KEYBOARD%;$KEYBOARD;g" -e "s;%KEYBOARD_UPPERCASE%;$KEYBOARD_UPPERCASE;g" quantum/template/template.h > keyboards/$KEYBOARD/$KEYBOARD.h
|
find keyboards/${KEYBOARD} -type f -exec sed -i "s;%KEYBOARD%;$KEYBOARD;g" {} \;
|
||||||
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/template.c > keyboards/$KEYBOARD/$KEYBOARD.c
|
find keyboards/${KEYBOARD} -type f -exec sed -i "s;%KEYBOARD_UPPERCASE%;$KEYBOARD_UPPERCASE;g" {} \;
|
||||||
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/rules.mk > keyboards/$KEYBOARD/rules.mk
|
|
||||||
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/config.h > keyboards/$KEYBOARD/keymaps/default/config.h
|
|
||||||
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/keymap.c > keyboards/$KEYBOARD/keymaps/default/keymap.c
|
|
||||||
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/Makefile > keyboards/$KEYBOARD/keymaps/default/Makefile
|
|
||||||
sed -e "s;%KEYBOARD%;$KEYBOARD;g" quantum/template/keymaps/default/readme.md > keyboards/$KEYBOARD/keymaps/default/readme.md
|
|
||||||
|
|
||||||
echo "######################################################"
|
echo "######################################################"
|
||||||
echo "# /keyboards/$KEYBOARD project created. To start"
|
echo "# /keyboards/$KEYBOARD project created. To start"
|
||||||
|
|
Loading…
Reference in a new issue