cd to the project root (identified by the presence of a SCM directory, like .git, or .bzr)
Put something like this in your .zshrc/.bashrc:
. /path/to/rooter.zsh (for the zsh version) . /path/to/rooter.sh (for the bash version)
This installs the
cdr command for use.
$ pwd /home/yeban/drizzle/drizzle/libdrizzle-2.0/libdrizzle $ cdr $ pwd /home/yeban/src/drizzle/drizzle
- Make it compatible with Bash.
- Make it more efficient? Currently, it iterates over each ancestral directory looking for a known SCM directory. Is there a better way?