diff options
author | QMK Bot <hello@qmk.fm> | 2022-03-18 16:02:57 +0000 |
---|---|---|
committer | QMK Bot <hello@qmk.fm> | 2022-03-18 16:02:57 +0000 |
commit | 3a08deb7fe0d83ca17a8a584fd68c98a018a1c17 (patch) | |
tree | 7397bd53ca9dad96498fc712bc8353af3fc2a1e4 /lib/python/qmk/cli | |
parent | bffb209eeeab1cc4d070217aa1bc65b6834cf42c (diff) | |
parent | ed773ab73cab83b842dc62ff94ffb337ec66a5f3 (diff) |
Merge remote-tracking branch 'origin/master' into develop
Diffstat (limited to 'lib/python/qmk/cli')
-rw-r--r-- | lib/python/qmk/cli/doctor/check.py | 12 | ||||
-rwxr-xr-x | lib/python/qmk/cli/doctor/main.py | 3 | ||||
-rw-r--r-- | lib/python/qmk/cli/generate/version_h.py | 8 | ||||
-rw-r--r-- | lib/python/qmk/cli/new/keyboard.py | 2 |
4 files changed, 7 insertions, 18 deletions
diff --git a/lib/python/qmk/cli/doctor/check.py b/lib/python/qmk/cli/doctor/check.py index 2d691b64b0..8a0422ba72 100644 --- a/lib/python/qmk/cli/doctor/check.py +++ b/lib/python/qmk/cli/doctor/check.py @@ -7,7 +7,6 @@ from subprocess import DEVNULL from milc import cli from qmk import submodules -from qmk.constants import QMK_FIRMWARE class CheckStatus(Enum): @@ -150,14 +149,3 @@ def is_executable(command): cli.log.error("{fg_red}Can't run `%s %s`", command, version_arg) return False - - -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 = QMK_FIRMWARE / '.git' - - return CheckStatus.OK if dot_git.exists() else CheckStatus.WARNING diff --git a/lib/python/qmk/cli/doctor/main.py b/lib/python/qmk/cli/doctor/main.py index 2e5e221e8f..2898a9894c 100755 --- a/lib/python/qmk/cli/doctor/main.py +++ b/lib/python/qmk/cli/doctor/main.py @@ -11,7 +11,8 @@ from milc.questions import yesno from qmk import submodules from qmk.constants import QMK_FIRMWARE, QMK_FIRMWARE_UPSTREAM from .check import CheckStatus, check_binaries, check_binary_versions, check_submodules -from qmk.commands import git_check_repo, git_get_branch, git_get_tag, git_is_dirty, git_get_remotes, git_check_deviation, in_virtualenv +from qmk.git import git_check_repo, git_get_branch, git_get_tag, git_is_dirty, git_get_remotes, git_check_deviation +from qmk.commands import in_virtualenv def os_tests(): diff --git a/lib/python/qmk/cli/generate/version_h.py b/lib/python/qmk/cli/generate/version_h.py index be9646748e..a75702c529 100644 --- a/lib/python/qmk/cli/generate/version_h.py +++ b/lib/python/qmk/cli/generate/version_h.py @@ -6,7 +6,7 @@ from milc import cli from qmk.path import normpath from qmk.commands import dump_lines -from qmk.commands import get_git_version +from qmk.git import git_get_version from qmk.constants import GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE TIME_FMT = '%Y-%m-%d-%H:%M:%S' @@ -33,9 +33,9 @@ def generate_version_h(cli): chibios_version = "NA" chibios_contrib_version = "NA" else: - git_version = get_git_version(current_time) - chibios_version = get_git_version(current_time, "chibios", "os") - chibios_contrib_version = get_git_version(current_time, "chibios-contrib", "os") + git_version = git_get_version() or current_time + chibios_version = git_get_version("chibios", "os") or current_time + chibios_contrib_version = git_get_version("chibios-contrib", "os") or current_time # Build the version.h file. version_h_lines = [GPL2_HEADER_C_LIKE, GENERATED_HEADER_C_LIKE, '#pragma once'] diff --git a/lib/python/qmk/cli/new/keyboard.py b/lib/python/qmk/cli/new/keyboard.py index 6fa9ad5b2c..1cdfe53206 100644 --- a/lib/python/qmk/cli/new/keyboard.py +++ b/lib/python/qmk/cli/new/keyboard.py @@ -10,7 +10,7 @@ from dotty_dict import dotty from milc import cli from milc.questions import choice, question -from qmk.commands import git_get_username +from qmk.git import git_get_username from qmk.json_schema import load_jsonschema from qmk.path import keyboard from qmk.json_encoders import InfoJSONEncoder |