From da39824043ea82cd946af4064e681c17352d3137 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Sat, 2 Sep 2023 21:49:31 +1000 Subject: [PATCH] Don't accidentally resolve qmk_firmware as userspace if it's the current working directory. --- lib/python/qmk/constants.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/python/qmk/constants.py b/lib/python/qmk/constants.py index b9555948e9f..6d6c3dedda0 100644 --- a/lib/python/qmk/constants.py +++ b/lib/python/qmk/constants.py @@ -16,7 +16,8 @@ def _detect_qmk_userspace(): current_dir = Path(environ['ORIG_CWD']) while len(current_dir.parts) > 1: if (current_dir / 'Makefile').is_file() and ((current_dir / 'keyboards').is_dir() or (current_dir / 'layouts').is_dir()): - return current_dir + if current_dir.resolve() != Path(QMK_FIRMWARE).resolve(): + return current_dir current_dir = current_dir.parent # Otherwise, use the environment variable or the configured default return environ.get('QMK_USERSPACE') or cli.config.user.overlay_dir or QMK_FIRMWARE