aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-03-13 10:17:39 +0800
committertypebrook <typebrook@gmail.com>2020-03-13 10:17:39 +0800
commit8ed80fe2329d7a79ae7f248c53da0dbd0d66f71e (patch)
tree161ca6e54c2b2e427b58b0833b060a9e146fba36
parent51dac48875154ae99d409616a1c4e49e4e890340 (diff)
Fix bug about private mark
Variable 'mark' should be reset everytime, or the value from previous line would persist.
-rwxr-xr-xgist2
1 files changed, 1 insertions, 1 deletions
diff --git a/gist b/gist
index 679f79d..a296362 100755
--- a/gist
+++ b/gist
@@ -316,7 +316,7 @@ _parse_response() {
316 | tac | sed -e 's/, /,/g' | nl -s' ' \ 316 | tac | sed -e 's/, /,/g' | nl -s' ' \
317 | while read -r index link file_url_array public file_num comment_num author description; do 317 | while read -r index link file_url_array public file_num comment_num author description; do
318 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 local blob_code; blob_code=$(echo "$file_url_array" | tr ',' '\n' | sed -E -e 's#.*raw/(.*)/.*#\1#' | sort | cut -c -7 | paste -s -d '-' -)
319 [[ $public == 'False' ]] && local mark=p 319 [[ $public == 'False' ]] && local mark=p || local mark=''
320 [[ -n $1 ]] && local index=$1 320 [[ -n $1 ]] && local index=$1
321 echo "$mark$index $link $blob_code $file_num $comment_num $author $description" | tr -d '"' 321 echo "$mark$index $link $blob_code $file_num $comment_num $author $description" | tr -d '"'
322 done 322 done