diff options
| author | typebrook <typebrook@gmail.com> | 2020-03-13 22:34:32 +0800 |
|---|---|---|
| committer | typebrook <typebrook@gmail.com> | 2020-03-13 22:34:32 +0800 |
| commit | 14e8e168215405c7235964b0d242cb6206b6bf24 (patch) | |
| tree | 56d2f2a9ceea8c954bdc5e9ebf8a386ffa56d279 | |
| parent | 26d6f84442360b0f49be63e2e57ae4b497f22f5c (diff) | |
Fix bug about parsing starred gists
| -rwxr-xr-x | gist | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -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 | ||