🐚 Fix: zsh indirekte Variable in crew_doctor

Problem: 'bad substitution' bei crew_doctor
→ ${!var} funktioniert nur in bash, nicht in zsh

Lösung:
- if BASH_VERSION → ${!loaded_check_var}
- elif ZSH_VERSION → ${(P)loaded_check_var}

Jetzt funktioniert crew_doctor in beiden Shells! 

🤖 Generated with Claude Code
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Branko May Trinkwald
2025-12-21 20:03:33 +01:00
parent 6fefaf9081
commit e96d6cc99e

View File

@@ -248,7 +248,15 @@ function crew_doctor() {
local lib_mtime=$(stat -f "%m" "$lib_file" 2>/dev/null || stat -c "%Y" "$lib_file" 2>/dev/null)
local loaded_check_var="WALDWAECHTER_LOADED_${lib_mtime}"
if [[ -z "${!loaded_check_var}" ]]; then
# Indirect variable expansion (bash: ${!var}, zsh: ${(P)var})
local loaded_value=""
if [[ -n "$BASH_VERSION" ]]; then
loaded_value="${!loaded_check_var}"
elif [[ -n "$ZSH_VERSION" ]]; then
loaded_value="${(P)loaded_check_var}"
fi
if [[ -z "$loaded_value" ]]; then
echo " ⚠️ waldwaechter.sh wurde aktualisiert!"
echo " → Bitte neu laden: source lib/waldwaechter.sh"
issues=$((issues + 1))