From 8ed80fe2329d7a79ae7f248c53da0dbd0d66f71e Mon Sep 17 00:00:00 2001 From: typebrook Date: Fri, 13 Mar 2020 10:17:39 +0800 Subject: Fix bug about private mark Variable 'mark' should be reset everytime, or the value from previous line would persist. --- gist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gist b/gist index 679f79d..a296362 100755 --- a/gist +++ b/gist @@ -316,7 +316,7 @@ _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 + [[ $public == 'False' ]] && local mark=p || local mark='' [[ -n $1 ]] && local index=$1 echo "$mark$index $link $blob_code $file_num $comment_num $author $description" | tr -d '"' done -- cgit v1.2.3-70-g09d2