2020-05-15 09:36:09 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
root="$(git rev-parse --show-toplevel 2>/dev/null)"
|
|
|
|
|
|
|
|
if [ -z "$root" ]
|
|
|
|
then
|
2021-02-25 08:56:39 +00:00
|
|
|
builtin cd "$@"
|
2020-05-15 09:36:09 +00:00
|
|
|
else
|
|
|
|
if [ -z "$1" ]
|
|
|
|
then
|
2021-02-25 08:56:39 +00:00
|
|
|
builtin cd "$root"
|
2020-05-15 09:36:09 +00:00
|
|
|
else
|
|
|
|
if [ $(echo "$1" | grep '^/') ]
|
2021-02-25 08:56:39 +00:00
|
|
|
then builtin cd "$root"$@
|
|
|
|
else builtin cd "$@"
|
2020-05-15 09:36:09 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-06-28 07:07:53 +00:00
|
|
|
source smartprompt
|