Remove PYTHONPATH from mac and update files to better lint

This commit is contained in:
ViViDboarder 2019-11-13 17:23:15 -08:00
parent 41483058c4
commit fa480a55a1
3 changed files with 24 additions and 19 deletions

View File

@ -2,12 +2,13 @@
IS_BASH_PROFILE_LOADED=true IS_BASH_PROFILE_LOADED=true
# If bashrc hasn't been loaded, load it # If bashrc hasn't been loaded, load it
if [ -z "$IS_BASHRC_LOADED" ] ; then if [ -z "$IS_BASHRC_LOADED" ] ; then
source $HOME/.bashrc # shellcheck source=bashrc
source "$HOME/.bashrc"
fi fi
# Some stuff is OS Dependent # Some stuff is OS Dependent
DET_OS="unknown" DET_OS="unknown"
UNAME_STR=`uname` UNAME_STR=$(uname)
if [[ "$UNAME_STR" == "Darwin" ]]; then if [[ "$UNAME_STR" == "Darwin" ]]; then
DET_OS="mac" DET_OS="mac"
@ -19,17 +20,17 @@ fi
if [[ "$DET_OS" == "mac" ]]; then if [[ "$DET_OS" == "mac" ]]; then
# Bash Completion # Bash Completion
if [ -f /opt/local/etc/profile.d/bash_completion.sh ]; then if [ -f /opt/local/etc/profile.d/bash_completion.sh ]; then
. /opt/local/etc/profile.d/bash_completion.sh source /opt/local/etc/profile.d/bash_completion.sh
fi fi
if [ -f /opt/local/share/bash-completion/completions/git-flow ]; then if [ -f /opt/local/share/bash-completion/completions/git-flow ]; then
. /opt/local/share/bash-completion/completions/git-flow source /opt/local/share/bash-completion/completions/git-flow
fi fi
fi fi
# Set prompt to include some useful information # Set prompt to include some useful information
function ps_git_branch { function ps_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo " ("${ref#refs/heads/}")" echo " (${ref#refs/heads/})"
} }
function ps_atf_target { function ps_atf_target {
@ -38,13 +39,13 @@ function ps_atf_target {
} }
function ps_force_target { function ps_force_target {
`git config force.use 2> /dev/null` || return test "true" = "$( git config force.use 2> /dev/null )" || return
org=$(force-target 2> /dev/null) || return org=$(force-target 2> /dev/null) || return
echo " [$org]" echo " [$org]"
} }
function ps_host_name { function ps_host_name {
[ -z $TMUX ] || return && echo '\h ' [ -z "$TMUX" ] || return && echo '\h '
} }
function ps_virtual_env { function ps_virtual_env {
@ -54,7 +55,7 @@ function ps_virtual_env {
} }
# Alias for colors # Alias for colors
RED="\[\033[0;31m\]" # RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]" YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]" GREEN="\[\033[0;32m\]"
ENDCOLOR="\[\e[0m\]" ENDCOLOR="\[\e[0m\]"
@ -70,7 +71,7 @@ export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad export LSCOLORS=ExFxCxDxBxegedabagacad
# Vim colors # Vim colors
[ -n "$VIM_COLOR" ] || export VIM_COLOR=$(eval $HOME/bin/get_vim_colorscheme.sh) || export VIM_COLOR='wombat256mod' [ -n "$VIM_COLOR" ] || export VIM_COLOR="$(eval "$HOME/bin/get_vim_colorscheme.sh")" || export VIM_COLOR='wombat256mod'
export FZF_DEFAULT_COMMAND='ag -g ""' export FZF_DEFAULT_COMMAND='ag -g ""'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND \$dir" export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND \$dir"

View File

@ -1,5 +1,5 @@
DET_OS="unknown" DET_OS="unknown"
UNAME_STR=`uname` UNAME_STR="$(uname)"
# Some settings are mac specific # Some settings are mac specific
if [[ "$UNAME_STR" == "Darwin" ]]; then if [[ "$UNAME_STR" == "Darwin" ]]; then
@ -9,8 +9,9 @@ elif [[ "$UNAME_STR" == "Linux" ]]; then
fi fi
# Source bash alaias # Source bash alaias
if [ -f ~/.bash_alias ]; then if [ -f "$HOME/.bash_alias" ]; then
. ~/.bash_alias # shellcheck source=bash_alias
source "$HOME/.bash_alias"
fi fi
# Common paths for me # Common paths for me
@ -32,9 +33,10 @@ elif [[ "$DET_OS" == "mac" ]]; then
# Fix Python path on OSX to avoid considering System extras over newer versions # Fix Python path on OSX to avoid considering System extras over newer versions
# Local # Local
export PATH=$HOME/Library/Python/3.7/bin:$HOME/Library/Python/2.7/bin:$PATH export PATH=$HOME/Library/Python/3.7/bin:$HOME/Library/Python/2.7/bin:$PATH
export PYTHONPATH=$HOME/Library/Python/2.7/lib/python/site-packages:$PYTHONPATH # Python path is causing other issues
# export PYTHONPATH=$HOME/Library/Python/2.7/lib/python/site-packages:$PYTHONPATH
# MacPorts and system # 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 # export PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/Current/lib/python2.7/site-packages:/Library/Python/2.7/site-packages:$PYTHONPATH
fi fi
# Android paths # Android paths
@ -62,6 +64,7 @@ if type rbenv &> /dev/null; then
eval "$(rbenv init -)" eval "$(rbenv init -)"
elif [ -d "$HOME/.rvm" ]; then elif [ -d "$HOME/.rvm" ]; then
export PATH="$PATH:$HOME/.rvm/bin" export PATH="$PATH:$HOME/.rvm/bin"
# shellcheck source=/dev/null
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function* [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
fi fi
@ -69,17 +72,18 @@ fi
if type npm &> /dev/null ; then if type npm &> /dev/null ; then
# This seems to fail in some cases # This seems to fail in some cases
npm_path=$(npm bin -g 2> /dev/null) npm_path=$(npm bin -g 2> /dev/null)
if [ -d "$npm_path" ] && echo $PATH | grep -qv "$npm_path"; then if [ -d "$npm_path" ] && echo "$PATH" | grep -qv "$npm_path"; then
export PATH=$npm_path:$PATH export PATH=$PATH:$npm_path
fi fi
fi fi
# Increase memory sizes for java using Ant # Increase memory sizes for java using Ant
ANT_OPTS="-Xmx2048m -Xms512m" export ANT_OPTS="-Xmx2048m -Xms512m"
# Set file as having been loaded to avoid looping # Set file as having been loaded to avoid looping
IS_BASHRC_LOADED=true IS_BASHRC_LOADED=true
# If an interactive shell and .bash_profile hasn't been loaded, load it # If an interactive shell and .bash_profile hasn't been loaded, load it
if [ -n "$PS1" ] && [ -z "$IS_BASH_PROFILE_LOADED" ] ; then if [ -n "$PS1" ] && [ -z "$IS_BASH_PROFILE_LOADED" ] ; then
source $HOME/.bash_profile # shellcheck source=bash_profile
source "$HOME/.bash_profile"
fi fi

View File

@ -22,7 +22,7 @@ else if [ $det_os = "mac" ]
# Fix Python path on OSX to avoid considering System extras over newer versions # Fix Python path on OSX to avoid considering System extras over newer versions
# Local # Local
set -gx PATH $HOME/Library/Python/3.7/bin $HOME/Library/Python/2.7/bin $PATH set -gx PATH $HOME/Library/Python/3.7/bin $HOME/Library/Python/2.7/bin $PATH
set -gx PYTHONPATH $HOME/Library/Python/2.7/lib/python/site-packages:$PYTHONPATH # set -gx PYTHONPATH $HOME/Library/Python/2.7/lib/python/site-packages:$PYTHONPATH
# Macports # Macports
set -gx PATH $PATH /opt/local/Library/Frameworks/Python.framework/Versions/Current/bin set -gx PATH $PATH /opt/local/Library/Frameworks/Python.framework/Versions/Current/bin
# set -gx PYTHONPATH /opt/local/Library/Frameworks/Python.framework/Versions/Current/lib $PYTHONPATH # set -gx PYTHONPATH /opt/local/Library/Frameworks/Python.framework/Versions/Current/lib $PYTHONPATH