diff options
Diffstat (limited to 'lib/python/qmk/commands.py')
| -rw-r--r-- | lib/python/qmk/commands.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/python/qmk/commands.py b/lib/python/qmk/commands.py index 8ff8501bf..8c66228b2 100644 --- a/lib/python/qmk/commands.py +++ b/lib/python/qmk/commands.py | |||
| @@ -240,6 +240,15 @@ def parse_configurator_json(configurator_file): | |||
| 240 | return user_keymap | 240 | return user_keymap |
| 241 | 241 | ||
| 242 | 242 | ||
| 243 | def git_get_username(): | ||
| 244 | """Retrieves user's username from Git config, if set. | ||
| 245 | """ | ||
| 246 | git_username = cli.run(['git', 'config', '--get', 'user.name']) | ||
| 247 | |||
| 248 | if git_username.returncode == 0 and git_username.stdout: | ||
| 249 | return git_username.stdout.strip() | ||
| 250 | |||
| 251 | |||
| 243 | def git_check_repo(): | 252 | def git_check_repo(): |
| 244 | """Checks that the .git directory exists inside QMK_HOME. | 253 | """Checks that the .git directory exists inside QMK_HOME. |
| 245 | 254 | ||
