# -*- mode: shell-script -*- source_if_exists() { [[ -f ${${(%):-%x}:A:h:h}/$1 ]] && . ${${(%):-%x}:A:h:h}/$1 || return 0 } export DOMAIN=${$(cut -d. -f2- -s <<<${HOST}):l} export HOST=${HOST:l} export UNAME=${$(uname):l} setopt EXTENDED_GLOB setopt REMATCH_PCRE source_if_exists dotfiles-${UNAME}/zsh/env source_if_exists dotfiles-${DOMAIN}/zsh/env source_if_exists dotfiles-${HOST}/zsh/env () { local dir for dir in ~/{.local/bin,bin} ${GOPATH:-~/go}/bin; do if [[ -d ${dir} && ${path[(I)${dir}]} -eq 0 ]]; then path=(${dir} ${path}) fi done }