legacy-dotfiles/zsh/.zsh/functions/cdp

14 lines
213 B
Text
Raw Permalink Normal View History

# -*- 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