aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2019-02-27 02:59:34 +1100
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-02-26 07:59:34 -0800
commit0d936b2fe6a2518f2562c59f7f84692590d77aa0 (patch)
tree06e42680d3c1cb5d1f162a1acf9c9b19eebd444a /util
parent7ba2bc765be62f969668847797b7eb3e6665db48 (diff)
downloadqmk_firmware-0d936b2fe6a2518f2562c59f7f84692590d77aa0.tar.gz
qmk_firmware-0d936b2fe6a2518f2562c59f7f84692590d77aa0.zip
Ask for your name when generating a new keyboard (#5214)
* Ask for your name when generating a new keyboard * Update docs * Apply suggestions from code review Co-Authored-By: fauxpark <fauxpark@gmail.com>
Diffstat (limited to 'util')
-rwxr-xr-xutil/new_project.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/util/new_project.sh b/util/new_project.sh
index d1d1ed82c..9dec714b0 100755
--- a/util/new_project.sh
+++ b/util/new_project.sh
@@ -43,7 +43,11 @@ GIT=$(whereis git)
43if [ "$GIT" != "" ]; then 43if [ "$GIT" != "" ]; then
44 IS_GIT_REPO=$($GIT log >>/dev/null 2>&1; echo $?) 44 IS_GIT_REPO=$($GIT log >>/dev/null 2>&1; echo $?)
45 if [ "$IS_GIT_REPO" -eq 0 ]; then 45 if [ "$IS_GIT_REPO" -eq 0 ]; then
46 ID="'$($GIT config --get user.name)'" 46 ID="$($GIT config --get user.name)"
47 read -rp "What is your name? [$ID] " YOUR_NAME
48 if [ -n "$YOUR_NAME" ]; then
49 ID=$YOUR_NAME
50 fi
47 echo "Using $ID as user name" 51 echo "Using $ID as user name"
48 52
49 for i in "$NEW_KBD/config.h" \ 53 for i in "$NEW_KBD/config.h" \
@@ -52,7 +56,7 @@ if [ "$GIT" != "" ]; then
52 "$NEW_KBD/keymaps/default/config.h" \ 56 "$NEW_KBD/keymaps/default/config.h" \
53 "$NEW_KBD/keymaps/default/keymap.c" 57 "$NEW_KBD/keymaps/default/keymap.c"
54 do 58 do
55 awk -v id="$ID" '{sub(/REPLACE_WITH_YOUR_NAME/,id); print}' < "$i" > "$i.$$" 59 awk -v id="$ID" '{sub(/%YOUR_NAME%/,id); print}' < "$i" > "$i.$$"
56 mv "$i.$$" "$i" 60 mv "$i.$$" "$i"
57 done 61 done
58 fi 62 fi