Add zsh function to go to a project's root dir

This commit is contained in:
Tom Willemse 2015-06-17 11:02:14 +02:00
parent 6d7bd71f13
commit ca31d59176

13
zsh/.zsh/functions/cdp Normal file
View file

@ -0,0 +1,13 @@
# -*- mode: sh; -*-
local _pwd=$(pwd)
while; do
cd ..
[[ ! -d '.git' && "$(pwd)" != "/" ]] || break
done
if [[ "$(pwd)" == "/" ]]; then
cd $_pwd
echo 'Project root not found' >&2
return 1
fi