Skip to content

Instantly share code, notes, and snippets.

@adam-phillipps
Created November 12, 2018 22:42
Show Gist options
  • Save adam-phillipps/8bdd1427bb3308103bcd8cfd98722240 to your computer and use it in GitHub Desktop.
Save adam-phillipps/8bdd1427bb3308103bcd8cfd98722240 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Export environment vars for nvm
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Bash completion for nvm
[[ -r $NVM_DIR/bash_completion ]] && \. $NVM_DIR/bash_completion
# added by Anaconda3 5.2.0 installer
export PATH="/anaconda3/bin:$PATH"
# added from brew install llvm -> manually putting this here so i can have
# facebook bals (fast computations)
export PATH="/usr/local/opt/llvm/bin:$PATH"
# Add chef to the path after rbenv so we can use both
export PATH="/opt/chefdb/bin:$PATH"
# Put aws cli in the PATH
export PATH=~/local/bin:$PATH
# Allow brew packages to be found in the path before OS packages
export PATH=/usr/local/bin:$PATH
# Set up an editor for Subversion
export EDITOR=/usr/bin/vim
# Scala environment variables for Spark stuff
export SCALA_HOME=/usr/local/opt/scala@2.11
export PATH=$PATH:$SCALA_HOME/bin
# Add the mysql-client to the path so it can be used without the whole path
export PATH=$PATH:/usr/local/opt/mysql-client/bin
# Used in spark and probably hadoop
export JAVA_HOME=$(/usr/libexec/java_home)
# Spark environment variables
# if which pyspark > /dev/null; then
# export SPARK_HOME=/usr/local/Cellar/apache-spark/2.3.0
# export PYTHONPATH=$SPARK_HOME/python:$SPARK_HOME/python/build:$PYTHONPATH
# export PYTHONPATH=$SPARK_HOME/python/lib/py4j-0.10.6-src.zip:$PYTHONPATH
# fi
# Add bash aliases from ~/.bash_aliases if the file exists
test -e ~/.bash_aliases && \
source ~/.bash_aliases
# Add shell-integration via script, if it exists
test -f ~/.iterm2_shell_integration.bash && \
source ~/.iterm2_shell_integration.bash
# Check for bash_completion file before using it
test -f /usr/local/etc/bash_completion && \
source /usr/local/etc/bash_completion
# Get bash auto-complete if the file exists
test -f /usr/local/etc/bash_completion && \
source /usr/local/etc/bash_completion
# Initialize Rbenv for Ruby version management
eval "$(rbenv init -)"
# Remove duplicates and trailing colons from the PATH
export PATH=$(echo -n $PATH | awk -v RS=: '{
if (!arr[$0]++){
printf("%s%s",!ln++?"":":",$0)
}
}' | sed 's/[:]*$//')
# Only source the bashrc file if tty
case $- in
*i*) source ~/.bashrc
esac
test -e "${HOME}/.iterm2_shell_integration.bash" && \
source "${HOME}/.iterm2_shell_integration.bash"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment