mirror of
				https://github.com/frebib/dotfiles.git
				synced 2024-06-14 12:57:23 +00:00 
			
		
		
		
	zsh: skip loading environment if ZDOTDIR is set
Loading the environment on every shell invocation is slow. We can speed up shell startup a little by skipping this for ever shell because it's loaded on login by systemd. Signed-off-by: Joe Groocock <me@frebib.net>
This commit is contained in:
		
							
								
								
									
										12
									
								
								zsh/.zshenv
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								zsh/.zshenv
									
									
									
									
									
								
							@@ -1,5 +1,11 @@
 | 
			
		||||
set -o allexport
 | 
			
		||||
. ~/.config/environment.d/*.conf
 | 
			
		||||
set +o allexport
 | 
			
		||||
# Assume environment is already loaded if ZDOTDIR is set.
 | 
			
		||||
# This speeds up starting zsh if it's not required. Attempt
 | 
			
		||||
# to load the environment if it's absent, though, in case
 | 
			
		||||
# ZDOTDIR is overriden and .zshrc is not in ~
 | 
			
		||||
if [ -z "$ZDOTDIR" ]; then
 | 
			
		||||
    set -o allexport
 | 
			
		||||
    . ~/.config/environment.d/*.conf
 | 
			
		||||
    set +o allexport
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
# vim: ft=sh
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user