From 1d71488f7046b7f2c470d64ce821692db9edfef2 Mon Sep 17 00:00:00 2001 From: typebrook Date: Wed, 5 Feb 2020 10:08:35 +0800 Subject: update --- scripts/gist | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/gist b/scripts/gist index b0fc6b6..71035dd 100755 --- a/scripts/gist +++ b/scripts/gist @@ -169,11 +169,11 @@ _show_list() { echo ' gist update' return 0 fi - local filter='/^s/ d; /^$/ d' - [[ $1 == "s" ]] && filter='/^[^s]/ d; /^$/ d' + local filter='/^ *s/ d; /^$/ d' + [[ $1 == "s" ]] && filter='/^ *[^ s]/ d; /^$/ d' while read index link blob_code file_num extra author description; do - [[ $1 == "s" ]] && local author=$author + [[ $1 == "s" ]] && local name=$author local repo=$folder/$(echo $link | sed 's#.*/##') local occupy=0 @@ -184,7 +184,7 @@ _show_list() { # if there is a commit not yet push, show red message "ahead" [[ -n $(cd $repo && git cherry) ]] 2>/dev/null && extra="\e[31m[ahead]\e[0m" && occupy=7 - echo -e $index $link $author $file_num $extra $(echo $description | cut -c -$(( 60 -$occupy -1 )) ) + echo -e "$(printf "% 3s" $index) $link $name $file_num $extra $(echo $description | cut -c -$(( 60 -$occupy -1 )) )" done < $INDEX \ | sed "$filter" echo -e '\nrun "gist help" for more details' > /dev/null -- cgit v1.2.3-70-g09d2