summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2020-01-08 00:10:32 +0000
committerGrégoire Duchêne <gduchene@awhk.org>2020-01-08 00:10:32 +0000
commit43e903bc4c014873119441eacaf586f1dcdccf54 (patch)
treeb7d670cc1186e1af212be2bbd7788243a6dc26da
parent4b32447683beeea38444b198a384a6adf99721cf (diff)
Get the dotfiles directory without a known path
-rw-r--r--zsh/env3
1 files changed, 1 insertions, 2 deletions
diff --git a/zsh/env b/zsh/env
index 6216765..0b14d38 100644
--- a/zsh/env
+++ b/zsh/env
@@ -1,8 +1,7 @@
# -*- mode: shell-script -*-
source_if_exists() {
- local f=~/.zshenv
- [[ -f ${f:A:h:h}/$1 ]] && . ${f:A:h:h}/$1 || return 0
+ [[ -f ${${(%):-%x}:A:h:h}/$1 ]] && . ${${(%):-%x}:A:h:h}/$1 || return 0
}
export DOMAIN=$(cut -d. -f2- -s <<<${HOST})