Permalink
Browse files

update iterm2 to use `/usr/local/bin/bash` as the default shell, and …

…update env vars for bash
  • Loading branch information...
ipatch committed Nov 4, 2018
1 parent eebd363 commit b0e9cfc1c80eae9c9ba4c3c7fd47d20e1a66fa58
Showing with 50 additions and 25 deletions.
  1. +9 −9 config/bash/bash_profile
  2. +36 −11 config/bash/bashrc
  3. +5 −5 terms/iterm2/com.googlecode.iterm2.plist
@@ -20,21 +20,21 @@ fi
HISTSIZE=1000000 # 1 Megabyte a.k.a 1MB

# test for git completions and git prompt
OS=$(uname)
if [[ $OS == Darwin ]]; then
if [ -f "/Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash" ]; then
source "/Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash"
fi
if [ -f "/Applications/Xcode.app/Contents/Develper/usr/share/git-core/git-prompt.sh" ]; then
source "/Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh"
fi
# OS=$(uname)
# if [[ $OS == Darwin ]]; then
# if [ -f "/Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash" ]; then
# source "/Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-completion.bash"
# fi
# if [ -f "/Applications/Xcode.app/Contents/Develper/usr/share/git-core/git-prompt.sh" ]; then
# source "/Applications/Xcode.app/Contents/Developer/usr/share/git-core/git-prompt.sh"
# fi

# TODO: figure out why below 2 env vars were not loading properly
#GIT_PS1_SHOWDIRTYSTATE=true;

#PS1='\[\033[32m\]\u@\h\[\033[00m\]:\[\033[34m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ ';

fi
# fi


# 💳 https://stackoverflow.com/a/18915067/708807
@@ -81,29 +81,54 @@ if [ -f ~/.bash_profile ]; then
source ~/.bash_profile
fi

# nuke $PATH because I manually set it up below
# NOTE: since $PATH is being nuked for each interactive bash session there presently isn't a need to check for duplicate path entries, "BONUS".
PATH=""

# TODO: create a `paths` func to load paths into `PATH`

# setup an $OS env var for distinguishing between different Operating Systems
# NOTE: Darwin = macOS, Linux = Debian; and other assorted Linux distros
os=$(/usr/bin/uname)
export os

# some homebrew magic
if [ "$os" = Darwin ] && [ -e /usr/local/bin/brew ]; then
brew_prefix="/usr/local"
export brew_prefix
elif [ "$os" = Linux ] && [ -e /home/linuxbrew/.linuxbrew/bin/brew ]; then
brew_prefix="/home/linuxbrew/.linuxbrew"
export brew_prefix
fi

# TODO: conditionally only add paths for different operating systems
# NOTE: since $PATH has been nuked, these paths are added from top to bottom, ie. .../sbin will be the first entry in $PATH unless other bash files hijack the $PATH; ...i'm looking at you asdf
export PATH="$PATH:/Users/capin/.asdf/installs/elixir/1.7.4/bin"
export PATH="$PATH:$brew_prefix/sbin"
export PATH="$PATH:$brew_prefix/bin"
export PATH="$PATH:$brew_prefix/opt/coreutils/libexec/gnubin"
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
export PATH="$PATH:/home/linuxbrew/.linuxbrew/bin/" # Add linuxbrew to the PATH
export PATH="$PATH:/usr/sbin"
export PATH="$PATH:/usr/bin"
export PATH="$PATH:/sbin"
export PATH="$PATH:/bin"

# source helpful files for working with the `asdf` version manager
if [ -f ~/.asdf/asdf.sh ]; then
source ~/.asdf/asdf.sh
fi
# if [ -f ~/.asdf/asdf.sh ]; then
# source ~/.asdf/asdf.sh
# fi

if [ -f ~/.asdf/completions/asdf.bash ]; then
source ~/.asdf/completions/asdf.bash
fi
# if [ -f ~/.asdf/completions/asdf.bash ]; then
# source ~/.asdf/completions/asdf.bash
# fi

# source helpful file for working with `fzf` CLI fuzzy finder
# NOTE: the below statement tests to see the `.fzf.bash` file exists in ~ and then loads into the interactive BASH session.
if [ -f ~/.fzf.bash ]; then
source ~/.fzf.bash
fi

# [ -f ~/.fzf.bash ] && source ~/.fzf.bash



# TODO: setup bash to use node.js provided by nvm and not homebrew
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
@@ -23,7 +23,7 @@
<key>Default Arrangement Name</key>
<string>single-window-main-desktop</string>
<key>Default Bookmark Guid</key>
<string>96493488-76CB-451C-84DB-A6B52B4BB38F</string>
<string>118366B5-3281-437A-A984-9A9ACDA5CB48</string>
<key>DimBackgroundWindows</key>
<true/>
<key>DimInactiveSplitPanes</key>
@@ -263,13 +263,13 @@
<key>NSWindow Frame SessionsPreferences</key>
<string>269 76 606 469 0 0 1440 877 </string>
<key>NSWindow Frame SharedPreferences</key>
<string>477 284 796 486 0 0 1440 877 </string>
<string>477 258 796 486 0 0 1440 877 </string>
<key>NSWindow Frame com.apple.typography_panel_ConsolasForPowerline</key>
<string>252 254 260 156 0 0 1440 877 </string>
<key>NSWindow Frame iTerm Window 0</key>
<string>185 333 810 451 0 0 1440 877 </string>
<string>6 0 1434 791 0 0 1440 877 </string>
<key>NSWindow Frame iTerm Window 1</key>
<string>3 383 1426 451 0 0 1440 877 </string>
<string>593 323 810 451 0 0 1440 877 </string>
<key>NSWindow Frame iTerm Window 10</key>
<string>2 315 714 451 0 0 1440 877 </string>
<key>NSWindow Frame iTerm Window 11</key>
@@ -4784,7 +4784,7 @@
<key>Set Local Environment Vars</key>
<true/>
<key>Shortcut</key>
<string></string>
<string>5</string>
<key>Show Mark Indicators</key>
<false/>
<key>Silence Bell</key>

0 comments on commit b0e9cfc

Please sign in to comment.