This commit is contained in:
tavo-wasd 2024-06-14 20:27:45 -06:00
parent 1b11bd3cbf
commit 3bfb1553d1
2 changed files with 6 additions and 6 deletions

View file

@ -54,12 +54,12 @@ short_time() {
short_path() {
curr_path="$(pwd | sed 's/\/home\/[A-Za-z]*/~/g')"
if [ "${#curr_path}" -gt 30 ] ; then
if [ "${#curr_path}" -gt 25 ] ; then
curr_path="${curr_path##*/}"
if git rev-parse --is-inside-work-tree >/dev/null 2>&1 ; then
curr_proj="$(git rev-parse --show-toplevel)"
curr_proj="$(git rev-parse --show-toplevel 2>/dev/null)"
curr_proj="${curr_proj##*/}"
if [ "$curr_path" != "$curr_proj" ] ; then
if [ "$curr_proj" ] && [ "$curr_path" != "$curr_proj" ] ; then
[ -d "../../$curr_proj/$curr_path" ] &&
curr_path="$curr_proj/$curr_path" ||
curr_path="$curr_proj/⋯/$curr_path"

View file

@ -39,12 +39,12 @@ short_time() {
short_path() {
curr_path="$(pwd | sed 's/\/home\/[A-Za-z]*/~/g')"
if [ "${#curr_path}" -gt 30 ] ; then
if [ "${#curr_path}" -gt 25 ] ; then
curr_path="${curr_path##*/}"
if git rev-parse --is-inside-work-tree >/dev/null 2>&1 ; then
curr_proj="$(git rev-parse --show-toplevel)"
curr_proj="$(git rev-parse --show-toplevel 2>/dev/null)"
curr_proj="${curr_proj##*/}"
if [ "$curr_path" != "$curr_proj" ] ; then
if [ "$curr_proj" ] && [ "$curr_path" != "$curr_proj" ] ; then
[ -d "../../$curr_proj/$curr_path" ] &&
curr_path="$curr_proj/$curr_path" ||
curr_path="$curr_proj/⋯/$curr_path"