-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_profile
121 lines (99 loc) · 2.91 KB
/
.bash_profile
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# shellcheck shell=bash
# OS variables
[ "$(uname -s)" = "Darwin" ] && export MACOS=1 && export UNIX=1
[ "$(uname -s)" = "Linux" ] && export LINUX=1 && export UNIX=1
uname -s | grep -q "_NT-" && export WINDOWS=1
grep -q "Microsoft" /proc/version 2>/dev/null && export UBUNTU_ON_WINDOWS=1
command_exists () {
type "$1" &> /dev/null ;
}
pathmunge () {
if ! echo "$PATH" | grep -Eq "(^|:)$1($|:)" ; then
if [ "$2" = "after" ] ; then
PATH="$PATH:$1"
else
PATH="$1:$PATH"
fi
fi
}
AIRPORTCMD="/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport"
if [ -x $AIRPORTCMD ]; then
alias airport=$AIRPORTCMD
fi
export GOPATH=$HOME/src/go
pathmunge $GOPATH/bin
pathmunge /usr/local/sbin
pathmunge $HOME/bin
if [ -d /opt/homebrew/bin ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
pathmunge "$HOMEBREW_PREFIX/opt/findutils/libexec/gnubin"
fi
if [ -d /home/linuxbrew/.linuxbrew/bin ]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
VSCODE_BINDIR="/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
if [ -d "$VSCODE_BINDIR" ]; then
pathmunge "$VSCODE_BINDIR" after
fi
if [ -d "${HOME}/.krew/bin" ]; then
pathmunge "${HOME}/.krew/bin" after
fi
if command_exists brew; then
if [[ -f $(brew --prefix)/etc/bash_completion ]]; then
source $(brew --prefix)/etc/bash_completion
fi
fi
if command_exists lsd; then
alias ls=lsd
else
if [ $MACOS ]; then
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
if command_exists gls; then
eval $(gdircolors)
alias ls="gls --color=aut"
fi
fi
fi
if command_exists hub; then
alias git=hub
fi
if command_exists vim; then
export EDITOR=$(type -p vim)
export GIT_EDITOR=$EDITOR
fi
if command_exists rbenv; then
eval "$(rbenv init -)"
fi
if command_exists pyenv; then
export PYENV_ROOT="$HOME/.pyenv"
pathmunge "$PYENV_ROOT/bin"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
if command_exists direnv; then
eval "$(direnv hook bash)"
fi
if command_exists asdf; then
. $(brew --prefix asdf)/libexec/asdf.sh
. $(brew --prefix asdf)/etc/bash_completion.d/asdf.bash
fi
if [ -f ~/.netrc ]; then
if grep -q goproxy.githubapp.com ~/.netrc; then
export GOPROXY=https://goproxy.githubapp.com/mod,https://proxy.golang.org/,direct
export GOPRIVATE=
export GONOPROXY=
export GONOSUMDB='github.com/github/*'
fi
fi
alias "kt=watch kubectl get nodes,pods,cronjobs --all-namespaces -o wide"
alias "y=yadm"
# check if this is a login and/or interactive shell
[ "$0" = "-bash" ] && export LOGIN_BASH="1"
echo "$-" | grep -q "i" && export INTERACTIVE_BASH="1"
# run bashrc if this is a login, interactive shell
if [ -n "$LOGIN_BASH" ] && [ -n "$INTERACTIVE_BASH" ]; then
source ~/.bashrc
fi
export PATH="$HOME/.cargo/bin:$PATH"