summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-02-05 10:08:35 +0800
committertypebrook <typebrook@gmail.com>2020-02-05 10:08:35 +0800
commit1d71488f7046b7f2c470d64ce821692db9edfef2 (patch)
tree0ddb02cbeb60fe79d6feb5f82b2407f4a839bc6d
parentf53d2965018fc033fcf29f0ef81044fe9d0799c7 (diff)
update
-rwxr-xr-xscripts/gist8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/gist b/scripts/gist
index b0fc6b6..71035dd 100755
--- a/scripts/gist
+++ b/scripts/gist
@@ -169,11 +169,11 @@ _show_list() {
169 echo ' gist update' 169 echo ' gist update'
170 return 0 170 return 0
171 fi 171 fi
172 local filter='/^s/ d; /^$/ d' 172 local filter='/^ *s/ d; /^$/ d'
173 [[ $1 == "s" ]] && filter='/^[^s]/ d; /^$/ d' 173 [[ $1 == "s" ]] && filter='/^ *[^ s]/ d; /^$/ d'
174 174
175 while read index link blob_code file_num extra author description; do 175 while read index link blob_code file_num extra author description; do
176 [[ $1 == "s" ]] && local author=$author 176 [[ $1 == "s" ]] && local name=$author
177 local repo=$folder/$(echo $link | sed 's#.*/##') 177 local repo=$folder/$(echo $link | sed 's#.*/##')
178 local occupy=0 178 local occupy=0
179 179
@@ -184,7 +184,7 @@ _show_list() {
184 # if there is a commit not yet push, show red message "ahead" 184 # if there is a commit not yet push, show red message "ahead"
185 [[ -n $(cd $repo && git cherry) ]] 2>/dev/null && extra="\e[31m[ahead]\e[0m" && occupy=7 185 [[ -n $(cd $repo && git cherry) ]] 2>/dev/null && extra="\e[31m[ahead]\e[0m" && occupy=7
186 186
187 echo -e $index $link $author $file_num $extra $(echo $description | cut -c -$(( 60 -$occupy -1 )) ) 187 echo -e "$(printf "% 3s" $index) $link $name $file_num $extra $(echo $description | cut -c -$(( 60 -$occupy -1 )) )"
188 done < $INDEX \ 188 done < $INDEX \
189 | sed "$filter" 189 | sed "$filter"
190 echo -e '\nrun "gist help" for more details' > /dev/null 190 echo -e '\nrun "gist help" for more details' > /dev/null