mirror of
https://github.com/meineerde/dotfiles.git
synced 2026-03-23 17:19:53 +00:00
Cleanup python bin paths
This commit is contained in:
parent
c4303dfad3
commit
c54edfad9c
16
.bashrc
16
.bashrc
@ -87,23 +87,19 @@ case `uname` in
|
|||||||
|
|
||||||
alias ls='ls -G'
|
alias ls='ls -G'
|
||||||
|
|
||||||
python="$(which python)"
|
|
||||||
python_path=""
|
|
||||||
# Find correct python bin path with multiple Pythons installed by Homebrew
|
# Find correct python bin path with multiple Pythons installed by Homebrew
|
||||||
if [[ "$python" =~ ^/usr/local/bin ]]; then
|
if [[ "$(which python)" =~ ^/usr/local/bin ]]; then
|
||||||
# Python comes from Homebrew
|
# Python comes from Homebrew
|
||||||
target=$(readlink "$python")
|
for p in $(ls -1d /usr/local/Cellar/python/*/bin | sort -r); do
|
||||||
if [[ $? ]]; then
|
export PATH=$p:$PATH
|
||||||
# the python binary is a symlink
|
done
|
||||||
python_path=$(cd "$(dirname "$python")" && cd "$(dirname "$target")" && pwd)
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
for p in "$python_path" /usr/local/*/bin /usr/*/bin; do
|
for p in /usr/local/*/bin /usr/*/bin; do
|
||||||
if [[ -n "$p" ]]; then
|
if [[ -n "$p" ]]; then
|
||||||
export PATH=$p:$PATH
|
export PATH=$p:$PATH
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
unset p python python_path
|
unset p
|
||||||
|
|
||||||
export PG_DATA=/usr/local/var/postgres
|
export PG_DATA=/usr/local/var/postgres
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user