aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-03-13 22:34:32 +0800
committertypebrook <typebrook@gmail.com>2020-03-13 22:34:32 +0800
commit14e8e168215405c7235964b0d242cb6206b6bf24 (patch)
tree56d2f2a9ceea8c954bdc5e9ebf8a386ffa56d279
parent26d6f84442360b0f49be63e2e57ae4b497f22f5c (diff)
Fix bug about parsing starred gists
-rwxr-xr-xgist5
1 files changed, 3 insertions, 2 deletions
diff --git a/gist b/gist
index 1cadc26..ead8d3c 100755
--- a/gist
+++ b/gist
@@ -315,9 +315,10 @@ _parse_response() {
315 | tac | sed -e 's/, /,/g' | nl -s' ' \ 315 | tac | sed -e 's/, /,/g' | nl -s' ' \
316 | while read -r index link file_url_array public file_num comment_num author description; do 316 | while read -r index link file_url_array public file_num comment_num author description; do
317 local blob_code; blob_code=$(echo "$file_url_array" | tr ',' '\n' | sed -E -e 's#.*raw/(.*)/.*#\1#' | sort | cut -c -7 | paste -s -d '-' -) 317 local blob_code; blob_code=$(echo "$file_url_array" | tr ',' '\n' | sed -E -e 's#.*raw/(.*)/.*#\1#' | sort | cut -c -7 | paste -s -d '-' -)
318 [[ $public == 'False' ]] && local mark=p || local mark='' 318 local prefix=$mark
319 [[ $public == 'False' ]] && prefix=p
319 [[ -n $1 ]] && local index=$1 320 [[ -n $1 ]] && local index=$1
320 echo "$mark$index $link $blob_code $file_num $comment_num $author $description" | tr -d '"' 321 echo "$prefix$index $link $blob_code $file_num $comment_num $author $description" | tr -d '"'
321 done 322 done
322} 323}
323 324