diff options
| author | Grégoire Duchêne <gduchene@awhk.org> | 2020-07-05 20:01:51 +0100 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@awhk.org> | 2020-07-05 20:01:51 +0100 |
| commit | 09b038046742ef35ee446ee8473663a491805ee2 (patch) | |
| tree | b8d7a43fa6b5d216cf241748ba1734c2dc8cf1f0 /zsh/env | |
| parent | 4435c0efc83b8fd0c2cae0a5fe0ce886b794552b (diff) | |
zsh: Add paths to ${PATH} in env instead of rc
Also, only add paths if they are not already in ${PATH}. This avoids
duplicates in subshells.
Diffstat (limited to 'zsh/env')
| -rw-r--r-- | zsh/env | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -14,3 +14,12 @@ 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 +} |
