Skip to content

Commit

Permalink
[pacman] Try to fix previous commit
Browse files Browse the repository at this point in the history
Still not 100% working. Decided to remove pyenv instead
  • Loading branch information
MarcelRobitaille committed Apr 2, 2021
1 parent 63ef142 commit fd9c38d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion zsh/custom/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,18 @@ chpwd
# Remove pyenv from PATH during yay
# Otherwise, it can install stuff to ~/.pyenv/...
function yay() {
PATH="$(echo $PATH | tr ':' '\n' | grep -v 'pyenv' | perl -pe 'chomp if eof' | tr '\n' ':')" command yay "$@"
ORIG_PATH=$PATH

function cleanup() {
export PATH=$ORIG_PATH
}

trap cleanup EXIT

export PATH="$(echo $PATH | tr ':' '\n' | \
grep --invert-match 'pyenv' | \
grep --invert-match 'venv' | \
([[ -n $VIRTUAL_ENV ]] && grep --invert-match $VIRTUAL_ENV || cat) | \
perl -pe 'chomp if eof' | tr '\n' ':')"
command yay "$@"
}

0 comments on commit fd9c38d

Please sign in to comment.