Skip to content

Commit

Permalink
zsh: Move PATH changes to .zprofile
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkaplan committed Sep 25, 2024
1 parent 92cf12f commit 60faca0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
1 change: 1 addition & 0 deletions default.conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@
~/.tmux.conf: tmux/.tmux.conf
~/.vimrc: vim/.vimrc
~/.vim: vim/
~/.zprofile: zsh/.zprofile
~/.zshenv: zsh/.zshenv
~/.zshrc: zsh/.zshrc
28 changes: 0 additions & 28 deletions etc/profile
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,6 @@ has() {
command -V "$1" > /dev/null 2>&1
}

source_if() {
if [ -e "$1" ]; then
source "$1"
fi
}

path_if() {
if [ -d "$1" ]; then
case ":$PATH:" in
*:"$1":*)
;;
*)
PATH="${1}${PATH:+:$PATH}"
esac
fi
}

source_if "${HOME}/.nix-profile/etc/profile.d/nix.sh"

path_if "$HOME/bin"
path_if "$HOME/.local/bin"
path_if /usr/local/bin
path_if /opt/homebrew/bin
path_if /opt/homebrew/sbin

unset -f source_if
unset -f path_if

if has gnome-keyring-daemon; then
eval "$(gnome-keyring-daemon --start)"
export SSH_AUTH_SOCK
Expand Down
27 changes: 27 additions & 0 deletions zsh/.zprofile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
source_if() {
if [ -e "$1" ]; then
source "$1"
fi
}

path_if() {
if [ -d "$1" ]; then
case ":$PATH:" in
*:"$1":*)
;;
*)
PATH="${1}${PATH:+:$PATH}"
esac
fi
}

source_if "${HOME}/.nix-profile/etc/profile.d/nix.sh"

path_if "$HOME/bin"
path_if "$HOME/.local/bin"
path_if /usr/local/bin
path_if /opt/homebrew/bin
path_if /opt/homebrew/sbin

unset -f source_if
unset -f path_if
2 changes: 1 addition & 1 deletion zsh/.zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ ${prompt}"
export RPROMPT=''

# aliases
source $HOME/.profile
source $HOME/.zprofile
source $HOME/.config/zsh/aliases

source $HOME/.config/zsh/j.sh
Expand Down

0 comments on commit 60faca0

Please sign in to comment.