# RELOAD SETTINGS
zshenv_reload_time=0 # load before first command
+zshenv_boot_time=$(date -d "$(uptime -s)" '+%s') # uptime in epoch seconds
# Automatically source ~/.zsh/env.update when the file changes (and exists).
# Can be used e.g. to update SSH_AGENT_PID and GPG_AGENT_INFO variables in
if ! zstat -A stat +mtime $file 2>/dev/null; then
return
fi
+ # File was modified before reboot. Skip it to prevent loading of old
+ # values.
+ if [[ $stat -lt $zshenv_boot_time ]]; then
+ return
+ fi
# File wasn't modified, nothing to do.
if [[ $stat -le $zshenv_reload_time ]]; then
return