zsh: Make "gb" more ergonomic
This commit is contained in:
@@ -289,10 +289,15 @@ clip() {
|
|||||||
|
|
||||||
gb() {
|
gb() {
|
||||||
_superproject="$(git rev-parse --show-superproject-working-tree)"
|
_superproject="$(git rev-parse --show-superproject-working-tree)"
|
||||||
|
_root="$(git rev-parse --show-toplevel)"
|
||||||
if [[ -n "${_superproject}" ]] ; then
|
if [[ -n "${_superproject}" ]] ; then
|
||||||
builtin cd "${_superproject}"
|
if [[ "$(pwd)" == "${_root}" ]] ; then
|
||||||
|
builtin cd "${_superproject}"
|
||||||
|
else
|
||||||
|
builtin cd "${_root}"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
builtin cd "$(git rev-parse --show-toplevel)"
|
builtin cd "${_root}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user