forked from mathiasbynens/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.path
85 lines (65 loc) · 2.6 KB
/
.path
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
# # If you come from bash you might have to change your $PATH.
# export PATH="$HOME/bin:$HOME/utils:$HOME/.local/bin:/opt/homebrew/bin:/usr/local/bin:/usr/local/sbin:$PATH"
# # coreutils, for gnubin utilities
# export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
# # Python 3.12
# export PATH="$PATH:/usr/local/opt/python@3.12/bin"
# # Jupyter Labs
# export PATH="$PATH:/usr/local/opt/python@3.11/bin:$HOME/Library/Python/3.11/bin/"
# # Add VSCodium (code)
# export PATH="$PATH:/Applications/VSCodium.app/Contents/Resources/app/bin"
# # Add Visual Studio Code (code)
# export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
# # Rust Cargo
# export PATH="$HOME/.cargo/bin:$PATH"
# # Setting PATH for Python 3.9
# # The original version is saved in .zprofile.pysave
# # PATH="/Library/Frameworks/Python.framework/Versions/3.9/bin:${PATH}"
# # export PATH
# # Remove redundant PATH dirs
# export PATH=$( echo -n $PATH | awk -v RS=: '!($0 in a) {a[$0]; printf("%s%s", length(a) > 1 ? ":" : "", $0)}' )
# force path & PATH to have unique values with:
typeset -U path PATH
# Add directory to beginning of 'path'
function path_prepend() {
path=("$1" "$path[@]")
# path[1,0]="$1"
}
# Add directory to end of 'path'
function path_append() {
path+=("$1")
}
# path order matters -- insure that your preferred items are earlier in the path.
# I.e., preferred dirs higher in 'prepend' and lower in 'append'
#PREPENDS - add to the beginning of the path - lower in this list is sooner in the path
# Homebrew and coreutils
if command -v /opt/homebrew/bin/brew &>/dev/null 2>&1; then
path_prepend "/opt/homebrew/bin"
elif command -v /usr/local/bin/brew &>/dev/null 2>&1; then
path_prepend "/usr/local/bin"
fi
if brew --prefix coreutils &>/dev/null 2>&1; then
path_prepend $(brew --prefix coreutils)/libexec/gnubin
fi
# Rust Cargo
path_prepend "$HOME/.cargo/bin"
# my 'normal' bin directories
my_executables=("$HOME/.local/bin" "$HOME/bin" "$HOME/utils")
for exe in "${my_executables[@]}" ;do
path_prepend "$exe"
done
# APPENDS - append to the end of the path
# Python 3.11 - installed with Homebrew
path_append "$(brew --prefix python@3.11)/bin"
# Python 3.12 - installed with Homebrew
path_append "$(brew --prefix python@3.12)/bin"
# Jupyter Labs
# same as the python paths above
# Modular Mojo
if [[ -v MODULAR_HOME ]]; then
path_append "$MODULAR_HOME/pkg/packages.modular.com_mojo/bin"
fi
# Add VSCodium (code)
path_append "/Applications/VSCodium.app/Contents/Resources/app/bin"
# Add Visual Studio Code (code)
path_append "/Applications/Visual Studio Code.app/Contents/Resources/app/bin"