-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenv
190 lines (150 loc) · 4.81 KB
/
env
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# Determine shell
if [[ -n "${ZSH_VERSION}" ]]; then
_SHELL=zsh
elif [[ -n "${BASH_VERSION}" ]]; then
_SHELL=bash
else
_SHELL=sh
fi
# Email address
EMAIL='[email protected]'
GIT_AUTHOR_EMAIL=$EMAIL
export EMAIL GIT_AUTHOR_EMAIL
# Default browser preference (used by sensible-browser on debian)
for B in firefox chrome chromium elinks links2; do
if which $B 2>/dev/null 1>/dev/null; then
export BROWSER=$B
break
fi
done
# Default pager (used by sensible-pager on debian)
export PAGER=less
# Default editor preference
for E in vim vi nano; do
if which $E 2>/dev/null 1>/dev/null; then
export EDITOR=$E
break
fi
done
# Initial path
PATH="$HOME/bin:$HOME/.local/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/games:/usr/games"
# Look for Vagrant
[[ -d /opt/vagrant/bin ]] && PATH="$PATH:/opt/vagrant/bin"
# Look for GNU gettext
[[ -d /usr/local/opt/gettext/bin ]] && PATH="${PATH}:/usr/local/opt/gettext/bin"
# Load system paths on Mac OS X
if [[ -f /etc/paths ]]; then
for P in $(</etc/paths); do
PATH="$PATH:$P"
done
fi
# Search for additional paths on Mac OS X
if [[ -d /etc/paths.d ]]; then
for F in $(find /etc/paths.d -mindepth 1 -maxdepth 1 -type d); do
for P in $(<$F); do
PATH="$PATH:$P"
done
done
fi
# Homebrew
if [[ -d "/opt/homebrew" ]]; then
export HOMEBREW_PREFIX="/opt/homebrew"
export HOMEBREW_CELLAR="/opt/homebrew/Cellar"
export HOMEBREW_REPOSITORY="/opt/homebrew"
export PATH="/opt/homebrew/bin:/opt/homebrew/sbin${PATH+:$PATH}"
export MANPATH="/opt/homebrew/share/man${MANPATH+:$MANPATH}:"
export INFOPATH="/opt/homebrew/share/info:${INFOPATH:-}"
fi
# Disable Homebrew tracking & hints
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_ENV_HINTS=1
# Heroku Toolbelt
[[ -d /usr/local/heroku/bin ]] && PATH="$PATH:/usr/local/heroku/bin"
# Puppet
[[ -d /opt/puppetlabs/bin ]] && PATH="${PATH}:/opt/puppetlabs/bin"
[[ -d /opt/puppetlabs/pdk/bin ]] && PATH="${PATH}:/opt/puppetlabs/pdk/bin"
# Ruby Gems on Arch Linux
#if which ruby 2>&1 >/dev/null; then
# export GEM_HOME=$(ruby -e 'puts Gem.user_dir')
# PATH="$PATH:$GEM_HOME/bin"
#fi
# VMWare Fusion
[[ -d "/Applications/VMware Fusion.app/Contents/Library" ]] && \
PATH="${PATH}:/Applications/VMware Fusion.app/Contents/Library"
# Composer
[[ -d "${HOME}/.composer/vendor/bin" ]] && PATH="${PATH}:${HOME}/.composer/vendor/bin"
# choosenim
[[ -d "${HOME}/.nimble/bin" ]] && PATH="${PATH}:${HOME}/.nimble/bin"
# goenv
GOENV_ROOT="${HOME}/.goenv"
if [[ -d "${GOENV_ROOT}" ]]; then
PATH="${GOENV_ROOT}/bin:${GOENV_ROOT}/shims:${PATH}"
export GOENV_ROOT
export GOENV_DISABLE_GOPATH=1
fi
# golang
[[ -d "/usr/local/go/bin" ]] && PATH="${PATH}:/usr/local/go/bin"
[[ -d "${HOME}/go/bin" ]] && PATH="${PATH}:${HOME}/go/bin"
# rbenv
[[ -d "${HOME}/.rbenv" ]] && PATH="${HOME}/.rbenv/bin:${PATH}"
# pyenv
[[ -d "${HOME}/.pyenv" ]] && export PYENV_ROOT="${HOME}/.pyenv"
[[ -n "${PYENV_ROOT}" ]] && PATH="${PYENV_ROOT}/bin:${PATH}"
# tfenv
which tfenv 1>/dev/null 2>/dev/null || PATH="${HOME}/.tfenv/bin:${PATH}"
# .NET Core SDK tools
[[ -d "${HOME}/.dotnet/tools" ]] && PATH="$PATH:${HOME}/.dotnet/tools"
# Export path
export PATH
# Determine platform
uname="$(uname -a)"
if [[ "${uname}" =~ "Darwin" ]]; then
PLATFORM=MacOS
elif [[ "${uname}" =~ "Linux" ]]; then
PLATFORM=Linux
else
PLATFORM="$(uname)"
fi
export PLATFORM
# golang
#[ -d "/usr/local/go" ]] && export GOROOT="/usr/local/go"
[[ -d "${HOME}/go" ]] && export GOPATH="${HOME}/go"
# Line numbers, color support and search insensitivity for less
export LESS="-NRi"
# Colours for less and manpages
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
# ls colours (OS X)
export CLICOLOR=1
# grep colors
export GREP_COLOR='1;32' # BSD
export GREP_COLORS='ms=01;32:mc=01;32:sl=:cx=:fn=34:ln=31:bn=31:se=36' # GNU
# Quilt settings
export QUILT_PATCHES=debian/patches
export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
# Rack/Rails environment
[[ -z "$RACK_ENV" ]] && export RACK_ENV=development
[[ -z "$RAILS_ENV" ]] && export RAILS_ENV=development
# Set HOSTNAME variable if empty
[[ -z "$HOSTNAME" ]] && export HOSTNAME=$(hostname)
# Ansible cow-free zone
export ANSIBLE_NOCOWS=1
# Experimental force localization
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# gnupg
export GPG_TTY="$(tty)"
# Azure Developer CLI (azd) no telemetry
export AZURE_DEV_COLLECT_TELEMETRY=no
# ulimit on MacOS
[ "${PLATFORM}" = "MacOS" ] && ulimit -n 10240
# Load secret env vars
[[ -e "${HOME}/secrets/env/default" ]] && source "${HOME}/secrets/env/default"
# Load local env vars
[[ -e "${HOME}/.env.local" ]] && source "${HOME}/.env.local"
# vim: set ft=sh ts=2 sts=2 sw=2 et: