From b021c2f2c5890df5335d3dd163167c6fe6213e0d Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 31 Jul 2021 06:57:40 +1000 Subject: Port new_keyboard.sh to CLI (#13706) Co-authored-by: Erovia --- lib/python/qmk/commands.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/python/qmk/commands.py') 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. -- cgit v1.2.3