Skip to content

Instantly share code, notes, and snippets.

@nthx
Last active August 29, 2015 14:17
Show Gist options
  • Save nthx/280e6c98eb1727fa04ef to your computer and use it in GitHub Desktop.
Save nthx/280e6c98eb1727fa04ef to your computer and use it in GitHub Desktop.
#.....
# configuration below *cannot* be inside .bashrc
. ~/public/github/dotfiles/bashrc.my.bash_zsh_support
#.....
function gitsh {
if [ -d .git ]; # should also skip if-already-executed
then
if [ ! -v INVOKED_GIT_SH ];
then
INVOKED_GIT_SH=true
git-sh
fi
fi
}
source ~/github/bash_zsh_support/chpwd/function.sh
source ~/github/bash_zsh_support/chpwd/load.sh
export -a chpwd_functions # define hooks as an shell array
[[ " ${chpwd_functions[*]} " == *" gitsh "* ]] || # prevent double addition
chpwd_functions+=(gitsh) # finally add it to the list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment