Adding some Go bits, correcting some warts

plus getting to the bottom of shell startup slowness, which appears to
be almost entirely due to rbenv.
This commit is contained in:
Dan Buch 2013-01-19 23:42:37 -05:00
parent 0f4906c00a
commit bc0fc62b2f
2 changed files with 47 additions and 27 deletions

View File

@ -1,3 +1,5 @@
#!/bin/bash
alias .bp="source $HOME/.bash_profile"
alias .sa="source $HOME/.ssh/agent.out"
alias be='bundle exec'
@ -15,12 +17,13 @@ alias sS='TERM=xterm screen -Rd -S '
alias scr='TERM=xterm screen -Rd'
alias sl="screen -ls"
if [[ "$(uname)" -eq "Linux" ]]
then
alias l='ls -F --color=auto'
else
# for darwin in particular
case "$(uname | tr '[:upper:]' '[:lower:]')" in
darwin)
alias l='ls -GF'
fi
;;
*)
alias l='ls -F --color=auto'
;;
esac
# vim:filetype=sh

View File

@ -35,9 +35,20 @@ _source_host_specific_rcfile(){
}
_source_bash_extras()
{
local _BASH_EXTRAS="
_source_if_exists() {
if [ -e "$1" ] ; then
_debug "sourcing $1"
if [ -n "$DEBUG" ] ; then
time source "$1"
else
source "$1"
fi
fi
}
_source_bash_extras() {
local _bash_extras="
$HOME/.bashrc_local
$HOME/.bash_aliases
$HOME/.bash_functions
@ -45,25 +56,31 @@ _source_bash_extras()
$HOME/.bash_completion
$HOME/.autoenv/activate.sh
"
for ext in $_BASH_EXTRAS ; do
if [ -e "$ext" ] ; then
_debug "sourcing $ext"
source $ext
fi
for ext in $_bash_extras ; do
_source_if_exists "$ext"
done
}
_bash_profile_main()
{
_bash_profile_main() {
source "$HOME/.bash_vars_common"
_source_host_specific_rcfile
_source_bash_extras
get_ssh_agent
get_gpg_agent
if [ -n "$DEBUG" ] ; then
export RBENV_DEBUG=1
time eval "$(rbenv init -)"
unset RBENV_DEBUG
else
eval "$(rbenv init -)"
test -f "$HOME/.gvm/scripts/gvm" && source "$HOME/.gvm/scripts/gvm"
fi
_source_if_exists "$HOME/.gvm/scripts/gvm"
_source_if_exists "$HOME/.gvmrc"
_source_if_exists "$HOME/src/gocode/src/.env"
unset _get_hostname
unset _source_host_specific_rcfile