Fix userspace detection in Makefile (#26117)

This commit is contained in:
Joel Challis 2026-03-30 04:24:32 +01:00 committed by GitHub
parent c7fde3d8cc
commit 9d24bc8a33
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 5 deletions

View File

@ -38,14 +38,16 @@ $(info QMK Firmware $(QMK_VERSION))
endif
endif
# Try to determine userspace from qmk config, if set.
ifeq ($(QMK_USERSPACE),)
QMK_USERSPACE = $(shell qmk config -ro user.overlay_dir | cut -d= -f2 | sed -e 's@^None$$@@g')
endif
# Determine which qmk cli to use
QMK_BIN := qmk
# Try to determine userspace from qmk config, if set. Handle direct query on qmk_cli>=1.1.7
# falling back to legacy method of only supporting user.overlay_dir config
export override QMK_USERSPACE := $(shell \
$(QMK_BIN) env | grep -q QMK_USERSPACE \
&& $(QMK_BIN) env QMK_USERSPACE \
|| $(QMK_BIN) config -ro user.overlay_dir | cut -d= -f2 | sed -e 's@^None$$@@g')
# avoid 'Entering|Leaving directory' messages
MAKEFLAGS += --no-print-directory