fix
This commit is contained in:
parent
1b11bd3cbf
commit
3bfb1553d1
2 changed files with 6 additions and 6 deletions
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue