From 14e8e168215405c7235964b0d242cb6206b6bf24 Mon Sep 17 00:00:00 2001 From: typebrook Date: Fri, 13 Mar 2020 22:34:32 +0800 Subject: Fix bug about parsing starred gists --- gist | 5 +++-- 1 file 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() { | tac | sed -e 's/, /,/g' | nl -s' ' \ | while read -r index link file_url_array public file_num comment_num author description; do local blob_code; blob_code=$(echo "$file_url_array" | tr ',' '\n' | sed -E -e 's#.*raw/(.*)/.*#\1#' | sort | cut -c -7 | paste -s -d '-' -) - [[ $public == 'False' ]] && local mark=p || local mark='' + local prefix=$mark + [[ $public == 'False' ]] && prefix=p [[ -n $1 ]] && local index=$1 - echo "$mark$index $link $blob_code $file_num $comment_num $author $description" | tr -d '"' + echo "$prefix$index $link $blob_code $file_num $comment_num $author $description" | tr -d '"' done } -- cgit v1.2.3-70-g09d2