diff --git a/lib/waldwaechter.sh b/lib/waldwaechter.sh index 95255f9..76a160c 100644 --- a/lib/waldwaechter.sh +++ b/lib/waldwaechter.sh @@ -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