summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorfauxpark <fauxpark@gmail.com>2019-02-26 16:59:34 +0100
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2019-02-26 16:59:34 +0100
commit0d936b2fe6a2518f2562c59f7f84692590d77aa0 (patch)
tree06e42680d3c1cb5d1f162a1acf9c9b19eebd444a /util
parent7ba2bc765be62f969668847797b7eb3e6665db48 (diff)
downloadqmk_firmware-0d936b2fe6a2518f2562c59f7f84692590d77aa0.tar.gz
qmk_firmware-0d936b2fe6a2518f2562c59f7f84692590d77aa0.tar.xz
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)
if [ "$GIT" != "" ]; then
IS_GIT_REPO=$($GIT log >>/dev/null 2>&1; echo $?)
if [ "$IS_GIT_REPO" -eq 0 ]; then
- ID="'$($GIT config --get user.name)'"
+ ID="$($GIT config --get user.name)"
+ read -rp "What is your name? [$ID] " YOUR_NAME
+ if [ -n "$YOUR_NAME" ]; then
+ ID=$YOUR_NAME
+ fi
echo "Using $ID as user name"
for i in "$NEW_KBD/config.h" \
@@ -52,7 +56,7 @@ if [ "$GIT" != "" ]; then
"$NEW_KBD/keymaps/default/config.h" \
"$NEW_KBD/keymaps/default/keymap.c"
do
- awk -v id="$ID" '{sub(/REPLACE_WITH_YOUR_NAME/,id); print}' < "$i" > "$i.$$"
+ awk -v id="$ID" '{sub(/%YOUR_NAME%/,id); print}' < "$i" > "$i.$$"
mv "$i.$$" "$i"
done
fi