Skip to content

Commit

Permalink
refactor dotfiles/zsh/.env
Browse files Browse the repository at this point in the history
  • Loading branch information
zy9306 committed Nov 2, 2023
1 parent 0f7e7e0 commit 54db25a
Showing 1 changed file with 7 additions and 37 deletions.
44 changes: 7 additions & 37 deletions dotfiles/zsh/.env
Original file line number Diff line number Diff line change
Expand Up @@ -58,27 +58,15 @@ fi

if [[ $(uname -s) == 'Darwin' ]]; then
for py_version in {"3.6","3.8","3.10"}; do
APPEND_PATH=/Library/Frameworks/Python.framework/Versions/${py_version}/bin
if [ -d $APPEND_PATH ]; then
if [[ $PATH != *"$APPEND_PATH"* ]]; then
export PATH=$APPEND_PATH:$PATH
fi
fi
prepend_path "/Library/Frameworks/Python.framework/Versions/${py_version}/bin"
done
prepend_path "/Users/$USER/Library/Python/3.10/bin"

TMP=/Library/Frameworks/Python.framework/Versions/${VIRTUALENVWRAPPER_PYTHON_VERSION}/bin/python${VIRTUALENVWRAPPER_PYTHON_VERSION}
if [ -f $TMP ]; then
export VIRTUALENVWRAPPER_PYTHON=$TMP
fi

APPEND_PATH=/Users/$USER/Library/Python/3.10/bin
if [ -d $APPEND_PATH ]; then
if [[ $PATH != *"$APPEND_PATH"* ]]; then
export PATH=$APPEND_PATH:$PATH
fi
fi

unset APPEND_PATH TMP
unset TMP
fi

if [[ $(uname -s) == "Linux" ]]; then
Expand Down Expand Up @@ -130,49 +118,31 @@ if [[ $(uname -s) == "Linux" ]]; then
fi

# Rust
if [ -d $HOME/.cargo/bin ]; then
APPEND_PATH="$HOME/.cargo/bin"
if [[ $PATH != *"$APPEND_PATH"* ]]; then
export PATH=$APPEND_PATH:$PATH
fi
fi
prepend_path "$HOME/.cargo/bin"

# Node fnm
# set npm: npm config set prefix '~/.npm_packages'
if [ ! -d $HOME/.fnm ]; then
mkdir -p $HOME/.fnm
fi

if [ -d $HOME/.fnm ]; then
APPEND_PATH="$HOME/.fnm"
if [[ $PATH != *"$APPEND_PATH"* ]]; then
export PATH=$APPEND_PATH:$PATH
fi
fi
prepend_path "$HOME/.fnm"

if [[ $(command_exists fnm) == true ]]; then
eval "$(fnm env)"
fi

# npm config set prefix '~/.npm_packages'
if [[ $(command_exists npm) == true ]]; then
APPEND_PATH="$HOME/.npm_packages/bin"
if [[ $PATH != *"$APPEND_PATH"* ]]; then
export PATH=$APPEND_PATH:$PATH
fi
prepend_path "$HOME/.npm_packages/bin"
fi

if [ -f /etc/profile.d/proxy.sh ]; then
source /etc/profile.d/proxy.sh
fi

# some path config
if [ -d $HOME/.local/bin ]; then
APPEND_PATH="$HOME/.local/bin/"
if [[ $PATH != *"$APPEND_PATH"* ]]; then
export PATH=$PATH:$APPEND_PATH
fi
fi
append_path "$HOME/.local/bin"

# ruby
if [[ $(command_exists rbenv) == true ]]; then
Expand Down

0 comments on commit 54db25a

Please sign in to comment.