zsh fun
Moving back to OSX as main machine I really needed to fix my ZSH scripts. Most of the scripts are stolen from others like a good developer should do :p
In the git prompt part it uses following code:
git_dir=$(git rev-parse --git-dir 2> /dev/null) || return
ZSH_GIT_FULL_DIR=$(readlink -f ${git_dir:h})
This has a problem as the readlink will not return anything if the dir is not a symbolic link.
So asking around on irc for other options someone stated this:
git_dir_=$(git rev-parse --git-dir 2> /dev/null) || return
git_dir=$(cd $git_dir_ && pwd)
ZSH_GIT_FULL_DIR=${git_dir:h}
Which did work and should also work on Linux machines.
Update your prompt scripts and continue the fun with ZSH and git.
If someone would like my scripts please comment and I'll give you a link to the archive. Being lazy as I am I will not create an archive unless someone really asks :p
blog comments powered by Disqus