summaryrefslogtreecommitdiff
path: root/bin/qmk
diff options
context:
space:
mode:
authorErovia <erovia@users.noreply.github.com>2020-02-20 01:10:56 +0100
committerFlorian Didron <fdidron@users.noreply.github.com>2020-06-12 17:00:27 +0900
commitc64bbdbc4bbd2dd07323edbb353bd5f31a1a86fa (patch)
tree0cb9afda2817ae1c5ea83b840c66c7fe1d489d8b /bin/qmk
parent2137d514322e4b67f2f0290d8415abf3fd691da8 (diff)
Use milc for config check, requirements fixes
Use milc's config finding and parsing to check if the user is a developer or not. 'requirements-dev.txt' will now load 'requirements.txt', so no need to run pip twice. Add missing 'yapf' dependency to 'requirements-dev.txt'.
Diffstat (limited to 'bin/qmk')
-rwxr-xr-xbin/qmk10
1 files changed, 4 insertions, 6 deletions
diff --git a/bin/qmk b/bin/qmk
index e4fb057ff2..b83f111e55 100755
--- a/bin/qmk
+++ b/bin/qmk
@@ -13,8 +13,8 @@ qmk_dir = script_dir.parent
python_lib_dir = Path(qmk_dir / 'lib' / 'python').resolve()
sys.path.append(str(python_lib_dir))
-# QMK CLI user config file
-config_file = Path(Path.home() / '.config/qmk/qmk.ini')
+# Setup the CLI
+import milc # noqa
def _check_modules(requirements):
@@ -24,7 +24,7 @@ def _check_modules(requirements):
for line in fd.readlines():
line = line.strip().replace('<', '=').replace('>', '=')
- if line[0] == '#':
+ if len(line) == 0 or line[0] == '#' or '-r' in line:
continue
if '#' in line:
@@ -53,12 +53,10 @@ developer = False
_check_modules('requirements.txt')
# For developers additional modules are needed
-if config_file.exists() and 'developer = True' in config_file.read_text():
+if milc.cli.config.user.developer:
developer = True
_check_modules('requirements-dev.txt')
-# Setup the CLI
-import milc # noqa
milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}'