forked from searls/icloud-dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.profile
130 lines (100 loc) · 3.54 KB
/
.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
122
123
124
125
126
127
128
129
130
# Sticking with bash for now.
export BASH_SILENCE_DEPRECATION_WARNING=1
# Initialize my "xenv" language runtime managers if installed
if command -v rbenv &>/dev/null; then
eval "$(rbenv init -)"
fi
if command -v pyenv &>/dev/null; then
eval "$(pyenv init -)"
fi
# Handle Mac platforms
CPU=$(uname -p)
if [[ "$CPU" == "arm" ]]; then
export PATH="/opt/homebrew/bin:$PATH"
alias oldbrew="/usr/local/bin/brew"
eval "$(/opt/homebrew/bin/brew shellenv)"
else
export PATH="/usr/local/bin:$PATH"
fi
# nvm deactivate 2>&1 /dev/null || echo "No nvm yet, that's okay."
# brew unlink node | grep -e "0 symlinks removed" > /dev/null || echo "Had to remove a brew-installed node, use nvm!" && brew uninstall --ignore-dependencies node
# npm config delete prefix
export NVM_DIR="$HOME/.nvm"
unset npm_config_prefix
unset PREFIX
# [ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh" 2>&1
[ -s "$NVM_DIR/nvm.sh" ] && source "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && source "$NVM_DIR/bash_completion"
nvm use --delete-prefix v10.17.0
# nvm use default 2>&1
nvm use 16
nvm use 16
# node --version 2>&1 /dev/null || nvm use default
# nvm use `cat .nvmrc` && npm config delete prefix || echo "Not in a .nvmrc dir"
# Additional PATH configuration
## My own scripts
PATH="$HOME/.bin:$PATH"
PATH="/usr/local/sbin:$PATH"
# PATH="/usr/local/share/npm/bin:$PATH"
# Bash settings
## stickier .bash_history
shopt -s histappend
## Set up bash git completion
if [ -f /Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash ]; then
source /Library/Developer/CommandLineTools/usr/share/git-core/git-completion.bash
fi
source "/Library/Developer/CommandLineTools/usr/share/git-core/git-prompt.sh"
## Set up tab-completion (requires `brew install bash-completion`)
if [ -f $(brew --prefix)/etc/bash_completion ]; then
source $(brew --prefix)/etc/bash_completion
fi
## Setup yarn tab-completion
[ -f ~/.config/yarn/global/node_modules/tabtab/.completions/yarn.bash ] && . ~/.config/yarn/global/node_modules/tabtab/.completions/yarn.bash
# Other Customization
## Editor registration for git, etc
export EDITOR=emacs
export CODE_DIR="$HOME/Code"
## Reference the location of iCloud Drive
export ICLOUD_DRIVE="$HOME/.icloud-drive"
PATH="$CODE_DIR/go_use/bin:$PATH"
## Source private (encrypted) ENV variables via automounted disk image
source "/Volumes/secure-dotfiles/.env"
## Increase limit of open file descriptors because watch processes
ulimit -n 10000
# Prepare Rails
#export RAILS_ENV="development"
#export RACK_ENV="development"
# Prepare Ruby
export RBENV_ROOT=/usr/local/var/rbenv
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
## Load aliases
source "$HOME/.aliases.bash"
# Conditionally enable my go_use utility
if command -v go_use_aliases &>/dev/null; then
source `which go_use_aliases`
source `which go_use_fixup_env`
fi
# Alias Hub as Git
eval "$(hub alias -s)"
# GPG Stuff
if [ -S ~/.gnupg/S.gpg-agent ]; then
echo "[gpg-agent]: status is good."
else
eval $(gpg-agent --daemon)
fi
## Fix GPG "Inappropriate ioctl for device"
export GPG_TTY=$(tty)
# load custom PS1 prompt
source $HOME/.bin/ps1
# Prepare Android
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
# gsl
export PATH="/usr/local/opt/gsl@1/bin:$PATH"
export PATH="/usr/local/opt/openssl/bin:$PATH"
export LIBRARY_PATH="$LIBRARY_PATH:/usr/local/opt/openssl/lib/"
npm config delete prefix
unset npm_config_prefix