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.
main
Dan Buch 11 years ago
parent 0f4906c00a
commit bc0fc62b2f

@ -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
alias l='ls -GF'
fi
case "$(uname | tr '[:upper:]' '[:lower:]')" in
darwin)
alias l='ls -GF'
;;
*)
alias l='ls -F --color=auto'
;;
esac
# vim:filetype=sh

@ -5,7 +5,7 @@ _debug(){
}
_get_hostname(){
_get_hostname() {
local hn="$(hostname -a 2>/dev/null || hostname)"
local ha=""
for host in $hn ; do
@ -21,7 +21,7 @@ _get_hostname(){
}
_source_host_specific_rcfile(){
_source_host_specific_rcfile() {
local _host_alias="`_get_hostname`"
if [[ ! -n "$_host_alias" ]] ; then
_host_alias="`hostname`"
@ -35,35 +35,52 @@ _source_host_specific_rcfile(){
}
_source_bash_extras()
{
local _BASH_EXTRAS="
$HOME/.bashrc_local
$HOME/.bash_aliases
$HOME/.bash_functions
/etc/bash_completion
$HOME/.bash_completion
$HOME/.autoenv/activate.sh
"
for ext in $_BASH_EXTRAS ; do
if [ -e "$ext" ] ; then
_debug "sourcing $ext"
source $ext
_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
/etc/bash_completion
$HOME/.bash_completion
$HOME/.autoenv/activate.sh
"
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
eval "$(rbenv init -)"
test -f "$HOME/.gvm/scripts/gvm" && source "$HOME/.gvm/scripts/gvm"
if [ -n "$DEBUG" ] ; then
export RBENV_DEBUG=1
time eval "$(rbenv init -)"
unset RBENV_DEBUG
else
eval "$(rbenv init -)"
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

Loading…
Cancel
Save