summaryrefslogtreecommitdiffstats
path: root/lib/python/qmk/commands.py
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2021-07-31 06:57:40 +1000
committerGitHub <noreply@github.com>2021-07-30 21:57:40 +0100
commitb021c2f2c5890df5335d3dd163167c6fe6213e0d (patch)
tree3d1f645190a819f13d7789a11c55b0706e1d9853 /lib/python/qmk/commands.py
parent770a52542592919e504603152f3a2950875150c9 (diff)
Port new_keyboard.sh to CLI (#13706)
Co-authored-by: Erovia <Erovia@users.noreply.github.com>
Diffstat (limited to 'lib/python/qmk/commands.py')
-rw-r--r--lib/python/qmk/commands.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/python/qmk/commands.py b/lib/python/qmk/commands.py
index 8ff8501bf6..8c66228b2b 100644
--- a/lib/python/qmk/commands.py
+++ b/lib/python/qmk/commands.py
@@ -240,6 +240,15 @@ def parse_configurator_json(configurator_file):
return user_keymap
+def git_get_username():
+ """Retrieves user's username from Git config, if set.
+ """
+ git_username = cli.run(['git', 'config', '--get', 'user.name'])
+
+ if git_username.returncode == 0 and git_username.stdout:
+ return git_username.stdout.strip()
+
+
def git_check_repo():
"""Checks that the .git directory exists inside QMK_HOME.