diff --git a/zsh/func/init-env-tilde-paths b/zsh/func/init-env-tilde-paths index d6af187..70acbd3 100644 --- a/zsh/func/init-env-tilde-paths +++ b/zsh/func/init-env-tilde-paths @@ -16,7 +16,7 @@ function init-env-tilde-paths break done - export df=~/.dotfiles + export df="$DOTFILES_HOME" } init-env-tilde-paths "$@" diff --git a/zshenv b/zshenv index ead3559..a322249 100644 --- a/zshenv +++ b/zshenv @@ -5,6 +5,22 @@ unsetopt GLOBAL_RCS export SYS=`uname -s | tr A-Z a-z` +function init-env-dotfiles-path +{ + local dotfiles_config="$HOME/.config/dotfiles-home" + if [[ -f "$dotfiles_config" ]]; then + export DOTFILES_HOME=$(cat "$dotfiles_config") + return + fi + + if [[ -f "$HOME/.dotfiles/setup.sh" ]]; then + export DOTFILES_HOME="$HOME/.dotfiles" + return + fi + + echo "WARNING: Couldn't find path to dotfiles" 1>&2 +} + function init-env-fpath { local -r fpath_candidates=( \ @@ -23,6 +39,7 @@ function init-env-fpath done } +init-env-dotfiles-path init-env-fpath autoload -Uz do_init_functions