# .zshenv - Start zsh with Hosho's shell integration and change no file
#
# A terminal with Hosho starts zsh with ZDOTDIR set to this folder, so zsh
# reads this file first. It gives ZDOTDIR back (HOSHO_USER_ZDOTDIR has the
# user's value, when there was one), reads the user's own .zshenv, and then the
# integration. zsh reads the user's other files (.zprofile, .zshrc, .zlogin)
# from the user's folder as always.

__hosho_folder=${${(%):-%x}:A:h:h}
if (( ${+HOSHO_USER_ZDOTDIR} )); then
	export ZDOTDIR=$HOSHO_USER_ZDOTDIR
	unset HOSHO_USER_ZDOTDIR
else
	unset ZDOTDIR
fi
[[ -f ${ZDOTDIR:-$HOME}/.zshenv ]] && source ${ZDOTDIR:-$HOME}/.zshenv
[[ -o interactive && -r $__hosho_folder/hosho.zsh ]] && source $__hosho_folder/hosho.zsh
unset __hosho_folder
