diff options
author | typebrook <typebrook@gmail.com> | 2020-03-13 10:17:39 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-03-13 10:17:39 +0800 |
commit | 8ed80fe2329d7a79ae7f248c53da0dbd0d66f71e (patch) | |
tree | 161ca6e54c2b2e427b58b0833b060a9e146fba36 | |
parent | 51dac48875154ae99d409616a1c4e49e4e890340 (diff) |
Fix bug about private mark
Variable 'mark' should be reset everytime, or the value from previous
line would persist.
-rwxr-xr-x | gist | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |