🐚 Fix: zsh Kompatibilität für crew_doctor & crew_syntax

Problem: export -f funktioniert nicht in zsh, nur in bash
→ crew_doctor und crew_syntax wurden nicht geladen in zsh

Lösung:
- Prüfe BASH_VERSION
- export -f nur in bash
- In zsh sind Funktionen automatisch verfügbar

Jetzt funktioniert waldwaechter.sh in beiden Shells:
 bash (export -f wird verwendet)
 zsh (Funktionen direkt verfügbar)

macOS Standard ist zsh → kritischer Fix!

🤖 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 19:51:24 +01:00
parent 7151749826
commit 43a16d30f2

View File

@@ -463,29 +463,36 @@ EOF
}
# Export functions so they're available in subshells
export -f mayaeule
export -f deepbit
export -f bugsy
export -f schnippsi
export -f templatus
export -f tobi
export -f schraubaer
export -f schnecki
export -f dumbosql
export -f funkfox
export -f taichitaube
export -f snakepy
export -f pepperphp
export -f crabbyrust
export -f spider
export -f vektor
export -f asciimonster
export -f crew_tokens
export -f crew_status
export -f crew_memory
export -f crew_doctor
export -f crew_syntax
export -f crew_help
# Note: export -f works in bash, but not in zsh
# In zsh, functions are automatically available in the current shell
# For bash compatibility, we still do export -f, but it's optional in zsh
if [[ -n "$BASH_VERSION" ]]; then
# Bash: use export -f
export -f mayaeule
export -f deepbit
export -f bugsy
export -f schnippsi
export -f templatus
export -f tobi
export -f schraubaer
export -f schnecki
export -f dumbosql
export -f funkfox
export -f taichitaube
export -f snakepy
export -f pepperphp
export -f crabbyrust
export -f spider
export -f vektor
export -f asciimonster
export -f crew_tokens
export -f crew_status
export -f crew_memory
export -f crew_doctor
export -f crew_syntax
export -f crew_help
fi
# In zsh, functions are available without export -f
# Set version marker for crew_doctor to detect reloads
if [[ -f "${WALDWAECHTER_DIR}/lib/waldwaechter.sh" ]]; then