summaryrefslogtreecommitdiff
path: root/lib/python/qmk/commands.py
diff options
context:
space:
mode:
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.