From 6d3554d18d3f3faf5f62958cc7282f397a440de0 Mon Sep 17 00:00:00 2001 From: James Patrick Date: Tue, 2 Jun 2020 23:26:08 -0400 Subject: [PATCH] Using zsh array path instead of $PATH. --- zsh/environment/host/wok/zshenv | 5 ++++- zsh/environment/host/zuk/zshenv | 6 ++++-- zsh/zshenv | 29 ++++++++++------------------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/zsh/environment/host/wok/zshenv b/zsh/environment/host/wok/zshenv index 82dcad4..48a56d8 100644 --- a/zsh/environment/host/wok/zshenv +++ b/zsh/environment/host/wok/zshenv @@ -1,3 +1,6 @@ export GOPATH="${HOME}/.go" PSQLAPP="/Applications/Postgres.app/Contents/Versions/latest" -export PATH="$PATH:${GOPATH}/bin:${PSQLAPP}/bin" +path=( + $GOPATH + $PSQLAPP + $path) diff --git a/zsh/environment/host/zuk/zshenv b/zsh/environment/host/zuk/zshenv index 7af7d5e..a06ba81 100644 --- a/zsh/environment/host/zuk/zshenv +++ b/zsh/environment/host/zuk/zshenv @@ -1,6 +1,8 @@ GOLANG_PATH="/usr/lib/go/bin" - export GOPATH="$HOME/src/go" -export PATH="$GOPATH/bin/:$GOLANG_PATH:$PATH" +path=( + $GOPATH + $GOLANG_PATH + $path) # vim: syn=zsh diff --git a/zsh/zshenv b/zsh/zshenv index 119f39b..95ece11 100644 --- a/zsh/zshenv +++ b/zsh/zshenv @@ -48,7 +48,6 @@ if [ -z "$SPACESHIP_PROMPT_ORDER" ]; then ) fi - # Set tmux profile default values. zstyle ':tmux:auto-start' local 'yes' zstyle ':tmux:auto-start' name 'tmux' @@ -65,28 +64,20 @@ export FZF_ALT_C_OPTS="--preview 'tree -C {} | head -100'" # Auto suggestion config ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=7" + +typeset -gU path +path=( + $HOME/.scripts/ + $HOME/~.emacs.d/bin/ + $HOME/.yarn/bin/ + $HOME/.config/yarn/global/node_modules/.bin/ + $HOME/.local/bin/ + $path) + # This will load the specified zsh files if they exist in the $ZDIR/environment directory. # It will load based on hostname & uname. env_loader(){ [ -e ${ZDIR}/environment/os/$OSTYPE/$1 ] && source ${ZDIR}/environment/os/$OSTYPE/$1 [ -e ${ZDIR}/environment/host/$HOST/$1 ] && source ${ZDIR}/environment/host/$HOST/$1 } - -if (( $+commands[yarn] )) ; then - export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH" -fi - -user_script_dir=~/.scripts -if [ -d $user_script_dir ] ; then - export PATH="$user_script_dir:$PATH" -fi - -if [ -d ~/.emacs.d/bin/ ] ; then - DOOM_BIN="$HOME/.emacs.d/bin" - export PATH="$DOOM_BIN:$PATH" -fi - env_loader zshenv - -# Dedup path. -typeset -gU path