aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorNick Brassel <[email protected]>2024-06-24 12:29:30 +1000
committerGitHub <[email protected]>2024-06-24 12:29:30 +1000
commit03e688e91f28d73416ada41c6db209c04d18cba7 (patch)
tree616d15901ba5e729d9c12d0c0f44e2ab29b4bf32 /lib/python
parentd5e0562a7043bf372c3f349420dd765ee3a9653d (diff)
downloadqmk_firmware-03e688e91f28d73416ada41c6db209c04d18cba7.tar.gz
qmk_firmware-03e688e91f28d73416ada41c6db209c04d18cba7.zip
Add support for userspace to docker build commands. (#23988)
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/qmk/cli/__init__.py1
-rwxr-xr-xlib/python/qmk/cli/userspace/path.py8
-rw-r--r--lib/python/qmk/tests/test_cli_commands.py2
3 files changed, 10 insertions, 1 deletions
diff --git a/lib/python/qmk/cli/__init__.py b/lib/python/qmk/cli/__init__.py
index 6d05a5fc21..b504aa5f8c 100644
--- a/lib/python/qmk/cli/__init__.py
+++ b/lib/python/qmk/cli/__init__.py
@@ -86,6 +86,7 @@ subcommands = [
'qmk.cli.userspace.compile',
'qmk.cli.userspace.doctor',
'qmk.cli.userspace.list',
+ 'qmk.cli.userspace.path',
'qmk.cli.userspace.remove',
'qmk.cli.via2json',
]
diff --git a/lib/python/qmk/cli/userspace/path.py b/lib/python/qmk/cli/userspace/path.py
new file mode 100755
index 0000000000..df4648e8c7
--- /dev/null
+++ b/lib/python/qmk/cli/userspace/path.py
@@ -0,0 +1,8 @@
+from milc import cli
+from qmk.constants import QMK_USERSPACE
+
+
[email protected]('Detected path to QMK Userspace.', hidden=True)
+def userspace_path(cli):
+ print(QMK_USERSPACE)
+ return
diff --git a/lib/python/qmk/tests/test_cli_commands.py b/lib/python/qmk/tests/test_cli_commands.py
index 1725e3ea79..8b50d1c340 100644
--- a/lib/python/qmk/tests/test_cli_commands.py
+++ b/lib/python/qmk/tests/test_cli_commands.py
@@ -249,7 +249,7 @@ def test_c2json_nocpp_stdin():
def test_clean():
result = check_subcommand('clean', '-a')
check_returncode(result)
- assert result.stdout.count('done') == 2
+ assert (result.stdout.count('done') == 2 and 'userspace' not in result.stdout) or (result.stdout.count('done') == 3 and 'userspace' in result.stdout)
def test_generate_api():