-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell-paths
86 lines (77 loc) · 3.09 KB
/
shell-paths
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Local
[ -f "$HOME/.shell-paths-local" ] && source "$HOME/.shell-paths-local"
# Bins
export PATH="$HOME/bin:$PATH"
export PATH="$HOME/.local/bin:$PATH"
export PATH="/usr/local/sbin:$PATH"
# Brew
if [ "$(arch)" = "i386" ] && [ -s "/usr/local/bin/brew" ]; then
export HOMEBREW_PREFIX="/usr/local"
elif [ -s "$HOME/.homebrew/bin/brew" ]; then
export HOMEBREW_PREFIX="$HOME/.homebrew"
elif [ -s "/opt/homebrew/bin/brew" ]; then
export HOMEBREW_PREFIX="/opt/homebrew"
fi
if [ -s "$HOMEBREW_PREFIX/bin/brew" ]; then
eval "$($HOMEBREW_PREFIX/bin/brew shellenv)"
fi
export PATH="$HOMEBREW_PREFIX/opt/openjdk/bin:$PATH"
export PATH="$HOMEBREW_PREFIX/opt/llvm/bin:$PATH"
# VSCode
if [ -d "/Applications/Visual Studio Code - Insiders.app" ]; then
export PATH="$PATH:/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin"
elif [ -d "/Applications/Visual Studio Code.app" ]; then
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
fi
# Java/Android
if [ -f "/usr/libexec/java_home" ]; then
export JAVA_HOME=$(/usr/libexec/java_home)
elif [ -d "/Library/Java/JavaVirtualMachines/openjdk.jdk/Contents/Home" ]; then
export JAVA_HOME="/Library/Java/JavaVirtualMachines/openjdk.jdk/Contents/Home"
fi
if [ -d "/opt/android_sdk" ]; then
export ANDROID_SDK="/opt/android_sdk"
export ANDROID_NDK_REPOSITORY="/opt/android_ndk"
export ANDROID_HOME="${ANDROID_SDK}"
else
export ANDROID_HOME="$HOME/Library/Android/sdk"
fi
if [ -d "$ANDROID_HOME" ]; then
export PATH="${PATH}:${ANDROID_HOME}/emulator:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools"
fi
# NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# and for brew installation
[ -s "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" ] && \. "$HOMEBREW_PREFIX/opt/nvm/nvm.sh" # This loads nvm
[ -s "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" ] && \. "$HOMEBREW_PREFIX/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
# Anaconda
if [ "$ANACONDA_ENABLED" = true ]; then
if [ -d "/opt/anaconda3" ]; then
export CONDA_PATH="/opt/anaconda3"
elif [ -d "$HOME/miniconda3" ]; then
export CONDA_PATH="$HOME/miniconda3"
elif [ -d "$HOME/anaconda3" ]; then
export CONDA_PATH="$HOME/anaconda3"
fi
if [ -d "$CONDA_PATH" ]; then
__conda_setup="$('${CONDA_PATH}' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "${CONDA_PATH}/etc/profile.d/conda.sh" ]; then
. "${CONDA_PATH}/etc/profile.d/conda.sh"
else
export PATH="${CONDA_PATH}/bin:$PATH"
fi
fi
unset __conda_setup
fi
fi
# RVM
export PATH="$PATH:$HOME/.rvm/bin"
# export PATH="$HOME/.rvm/bin:$PATH"
[ -s "$HOME/.rvm/scripts/rvm" ] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# Rust
[ -s "$HOME/.cargo/env" ] && source "$HOME/.cargo/env"