#!/usr/bin/env zsh
#

# load global sh env vars
[ -f "$XDG_CONFIG_HOME/sh/env" ] && source "$XDG_CONFIG_HOME/sh/env"
if [ -d "$XDG_CONFIG_HOME/sh/env.d" ]; then
  for _env in "$XDG_CONFIG_HOME/sh/env.d"/*.sh; do
    . "$_env"
  done
  unset _env
fi

# load zsh specific env vars
if [ -d "$XDG_CONFIG_HOME/zsh/env.d" ]; then
  for _env in "$XDG_CONFIG_HOME/zsh/env.d"/*.zsh; do
    . "$_env"
  done
  unset _env
fi

# add XDG_CONFIG_HOME/zsh/completions to fpath
# zsh uses it to look for completions; throw all
# completions in these dotfiles in there
fpath=("$XDG_CONFIG_HOME/zsh/completions" $fpath)
