summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2020-12-20 14:46:35 +0000
committerQMK Bot <hello@qmk.fm>2020-12-20 14:46:35 +0000
commitd7385676bc3ef419adf76f00f42c9b19b572149e (patch)
treeec33e86850866d5a24b49ec1d7a1ff03f26b6302
parentaee17984768c48613d215c2c0939cc9ba9b9dcdd (diff)
parent0239ce025aca542e4e37ec9003399bab2e92d82b (diff)
Merge remote-tracking branch 'origin/master' into develop
-rwxr-xr-xlib/python/qmk/cli/doctor.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/python/qmk/cli/doctor.py b/lib/python/qmk/cli/doctor.py
index 25e2e239cb..ea1113c645 100755
--- a/lib/python/qmk/cli/doctor.py
+++ b/lib/python/qmk/cli/doctor.py
@@ -154,6 +154,17 @@ def check_submodules():
return CheckStatus.OK
+def check_git_repo():
+ """Checks that the .git directory exists inside QMK_HOME.
+
+ This is a decent enough indicator that the qmk_firmware directory is a
+ proper Git repository, rather than a .zip download from GitHub.
+ """
+ dot_git_dir = QMK_FIRMWARE / '.git'
+
+ return CheckStatus.OK if dot_git_dir.is_dir() else CheckStatus.WARNING
+
+
def check_udev_rules():
"""Make sure the udev rules look good.
"""
@@ -338,6 +349,13 @@ def doctor(cli):
cli.log.info('QMK home: {fg_cyan}%s', QMK_FIRMWARE)
+ # Make sure our QMK home is a Git repo
+ git_ok = check_git_repo()
+
+ if git_ok == CheckStatus.WARNING:
+ cli.log.warning("QMK home does not appear to be a Git repository! (no .git folder)")
+ status = CheckStatus.WARNING
+
# Make sure the basic CLI tools we need are available and can be executed.
bin_ok = check_binaries()