diff options
| author | Ahmed Abdelhalim <[email protected]> | 2021-06-28 19:15:42 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2021-06-28 19:15:42 +0200 |
| commit | e04911b499de88952e157887956cef4bb045c03c (patch) | |
| tree | 8289f9d06590e1253e2c08a80d916876b8c74152 | |
| parent | eae1a046c21fcb4962caa962d50bb45ff1c807d6 (diff) | |
Conditionally setup included tools for OS X
| -rw-r--r-- | .bash_profile | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/.bash_profile b/.bash_profile index b4709ab..7951242 100644 --- a/.bash_profile +++ b/.bash_profile @@ -46,26 +46,36 @@ export PATH="/usr/local/bin:$PATH" export PATH="/usr/local/sbin:$PATH" # ==== rbenv config. -export PATH="$HOME/.rbenv/bin:$PATH" -eval "$(rbenv init -)" +if command -v rbenv 1>/dev/null 2>&1; then + export PATH="$HOME/.rbenv/bin:$PATH" + eval "$(rbenv init -)" +fi # ==== NVM config # node version manager from homebrew ,the source line to move install location # and prevent Node installs being lost upon upgrading nvm. -export NVM_DIR=~/.nvm -source $(brew --prefix nvm)/nvm.sh +if [ -d $HOME/.nvm ]; then + export NVM_DIR=~/.nvm + source $(brew --prefix nvm)/nvm.sh +fi # ==== pyenv config (and virtualenv) -eval "$(pyenv init --path)" -eval "$(pyenv init -)" -eval "$(pyenv virtualenv-init -)" +if command -v pyenv 1>/dev/null 2>&1; then + eval "$(pyenv init --path)" + eval "$(pyenv init -)" + eval "$(pyenv virtualenv-init -)" +fi # ==== Rust config -source "$HOME/.cargo/env" +if [ -f $HOME/.cargo/env ]; then + source "$HOME/.cargo/env" +fi # ==== MISC config -# allow fuck to be alias of thefuck -eval $(thefuck --alias) +if command -v thefuck 1>/dev/null 2>&1; then + # allow fuck to be alias of thefuck + eval $(thefuck --alias) +fi # ==== MISC CowSay fortune | cowsay | lolcat |
