shoestrap/assets/default/dotfiles/bashrc

120 lines
3.4 KiB
Bash
Raw Permalink Normal View History

2013-08-08 03:23:13 +00:00
DET_OS="unknown"
UNAME_STR="$(uname)"
2013-08-08 03:23:13 +00:00
# Some settings are mac specific
if [[ "$UNAME_STR" == "Darwin" ]]; then
DET_OS="mac"
elif [[ "$UNAME_STR" == "Linux" ]]; then
DET_OS="linux"
fi
# Source bash alaias
if [ -f "$HOME/.bash_alias" ]; then
# shellcheck source=bash_alias
source "$HOME/.bash_alias"
2013-08-08 03:23:13 +00:00
fi
# Common paths for me
export PATH=$PATH:$ANT_HOME/bin
# Opt directory
2016-02-04 18:33:08 +00:00
if [ -d /opt/local ]; then
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export LDFLAGS="$LDFLAGS-L/opt/local/lib"
export CFLAGS="$CFLAGS-L/opt/local/include"
2016-02-04 18:33:08 +00:00
fi
2013-08-08 03:23:13 +00:00
if [[ "$DET_OS" == "linux" ]]; then
2024-06-24 18:51:47 +00:00
export ANDROID_HOME="$HOME/workspace/adt-bundle-linux/sdk"
2021-07-26 01:43:12 +00:00
GOROOT=/usr/local/go
2013-08-08 03:23:13 +00:00
elif [[ "$DET_OS" == "mac" ]]; then
2024-06-24 18:51:47 +00:00
export ANDROID_HOME="$HOME/Library/Android/sdk"
2016-02-04 18:33:08 +00:00
# Set GOPATH
GOROOT=/opt/local/lib/go
GOPATH=$HOME/workspace/go_path
2015-06-13 00:34:49 +00:00
# Fix Python path on OSX to avoid considering System extras over newer versions
2019-10-29 01:15:00 +00:00
# Local
2023-10-31 15:58:30 +00:00
export PATH=$HOME/Library/Python/2.7/bin:$PATH
export PATH=$HOME/Library/Python/3.8/bin:$PATH
export PATH=$HOME/Library/Python/3.9/bin:$PATH
export PATH=$HOME/Library/Python/3.10/bin:$PATH
export PATH=$HOME/Library/Python/3.11/bin:$PATH
# Python path is causing other issues
# export PYTHONPATH=$HOME/Library/Python/2.7/lib/python/site-packages:$PYTHONPATH
2019-10-29 01:15:00 +00:00
# MacPorts and system
# export PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/Current/lib/python2.7/site-packages:/Library/Python/2.7/site-packages:$PYTHONPATH
2013-08-08 03:23:13 +00:00
fi
2016-02-04 18:33:08 +00:00
# Android paths
2024-06-24 18:51:47 +00:00
if [ -d "$ANDROID_HOME" ]; then
export PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools
fi
# Java paths
if type /usr/libexec/java_home &> /dev/null && /usr/libexec/java_home &> /dev/null ; then
2024-06-24 18:51:47 +00:00
export JAVA_HOME="$(/usr/libexec/java_home)"
fi
# Go paths
if [ -d "$GOPATH" ]; then
export GOPATH
export PATH=$PATH:$GOPATH/bin
fi
if [ -d "$GOROOT" ]; then
export GOROOT
export PATH=$PATH:$GOROOT/bin
fi
2016-02-04 18:33:08 +00:00
# Home path
2017-11-01 01:38:31 +00:00
export PATH=$HOME/bin:$HOME/.local/bin:$PATH
2013-08-08 03:23:13 +00:00
2016-02-04 18:33:08 +00:00
# Add RVM to PATH for scripting
2019-06-12 18:06:33 +00:00
if type rbenv &> /dev/null; then
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
elif [ -d "$HOME/.rvm" ]; then
2017-11-16 18:22:02 +00:00
export PATH="$PATH:$HOME/.rvm/bin"
# shellcheck source=/dev/null
2017-11-16 18:22:02 +00:00
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
fi
2013-08-08 03:23:13 +00:00
2018-04-05 23:10:38 +00:00
# NPM paths
2019-11-09 20:35:17 +00:00
if type npm &> /dev/null ; then
# This seems to fail in some cases
2019-11-09 20:35:17 +00:00
npm_path=$(npm bin -g 2> /dev/null)
if [ -d "$npm_path" ] && echo "$PATH" | grep -qv "$npm_path"; then
export PATH=$PATH:$npm_path
2019-11-09 20:35:17 +00:00
fi
2018-04-05 23:10:38 +00:00
fi
2021-12-15 02:06:30 +00:00
# Add luarocks paths
if type luarocks &> /dev/null ; then
eval "$(luarocks path)"
luarocks_bin=$HOME/.luarocks/bin
if [ -d "$luarocks_bin" ] && echo "$PATH" | grep -qv "$luarocks_bin"; then
export PATH=$PATH:$luarocks_bin
fi
fi
2013-08-08 03:23:13 +00:00
# Increase memory sizes for java using Ant
export ANT_OPTS="-Xmx2048m -Xms512m"
2013-08-08 03:23:13 +00:00
2022-09-28 18:35:50 +00:00
# Set vim or nvim to default editor
if type nvim &> /dev/null ; then
export EDITOR=nvim
else
export EDITOR=vim
fi
2020-11-19 19:47:31 +00:00
export VISUAL="$EDITOR"
2013-08-08 03:23:13 +00:00
# Set file as having been loaded to avoid looping
IS_BASHRC_LOADED=true
# If an interactive shell and .bash_profile hasn't been loaded, load it
if [ -n "$PS1" ] && [ -z "$IS_BASH_PROFILE_LOADED" ] ; then
# shellcheck source=bash_profile
source "$HOME/.bash_profile"
2013-08-08 03:23:13 +00:00
fi
# vim: set filetype=sh: