From 1ed42c76456e4b0ef8d4ebca80a9f8d6500927c0 Mon Sep 17 00:00:00 2001 From: librelad Date: Sat, 29 Aug 2026 02:35:19 +0100 Subject: [PATCH] fix(validate): only judge configs/ files that are actually sourced MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit validateSystemConfiguration ran `bash -n` over every file two levels deep under configs/, so a data file in a directory with no .category marker was reported as "does not parse as shell" — a configuration problem about a file nothing executes, pointing whoever read it at the wrong thing. Apply the same rule the loader uses: a file in a SUBDIRECTORY is judged only when that directory carries .category. Files directly in configs/ are checked as before. No behaviour change for any real config — every category (webui, general, security, backup, network) carries the marker. Co-Authored-By: Claude Opus 5 --- scripts/validation/validate_config.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/validation/validate_config.sh b/scripts/validation/validate_config.sh index e55c421..b2ae79b 100644 --- a/scripts/validation/validate_config.sh +++ b/scripts/validation/validate_config.sh @@ -299,6 +299,16 @@ validateSystemConfiguration() local f while IFS= read -r f; do [[ -f "$f" ]] || continue + # Only judge what actually gets sourced. sourceScanFiles sources a file in + # a SUBDIRECTORY only when that directory carries .category, so an unmarked + # directory holds ordinary data — and "does not parse as shell" is a + # meaningless complaint about a file nothing executes. Reporting it as a + # config problem sends someone fixing the wrong thing. Depth-1 files + # (directly in configs/) are checked as before, matching the loader. + local parent_dir="${f%/*}" + if [[ "$parent_dir" != "${configs_dir%/}" && ! -f "$parent_dir/.category" ]]; then + continue + fi bash -n "$f" 2>/dev/null || _lpvFail "$(basename "$f") does not parse as shell." local dup dup=$(grep -oE '^CFG_[A-Z0-9_]+=' "$f" | sort | uniq -d | tr -d '=')