Make sure grmlzshrc is only loaded once
authorFrank Terbeck <ft@grml.org>
Wed, 9 Mar 2011 10:15:38 +0000 (11:15 +0100)
committerFrank Terbeck <ft@grml.org>
Thu, 21 Jul 2011 19:40:10 +0000 (21:40 +0200)
It may happen, that /etc/zsh/zshrc and ~/.zshrc are both the same file,
in which case everything is loaded twice. This should fix the issue.

etc/zsh/zshrc

index b56cd09..f9d51b2 100644 (file)
 #   *all* aliases, for example, use @@INSERT-aliases-all@@.
 #}}}
 
+# Only load once
+[[ ${(t)GRML} != *association* ]] && typeset -gA GRML
+if (( ${GRML[ZSHRC_LOADED]} )); then
+    return 0
+else
+    GRML[ZSHRC_LOADED]=1
+fi
+
 # zsh profiling {{{
 # just execute 'ZSH_PROFILE_RC=1 zsh' and run 'zprof' to get the details
 if [[ $ZSH_PROFILE_RC -gt 0 ]] ; then