diff options
-rwxr-xr-x | gist | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -339,7 +339,7 @@ _parse_response() { | |||
339 | | while read -r "${INDEX_FORMAT[@]:0:2}" file_url_array public "${INDEX_FORMAT[@]:3:6}"; do | 339 | | while read -r "${INDEX_FORMAT[@]:0:2}" file_url_array public "${INDEX_FORMAT[@]:3:6}"; do |
340 | local blob_code; blob_code=$(echo "$file_url_array" | tr ',' '\n' | sed -E -e 's#.*raw/(.*)/.*#\1#' | sort | cut -c -7 | paste -s -d '-' -) | 340 | local blob_code; blob_code=$(echo "$file_url_array" | tr ',' '\n' | sed -E -e 's#.*raw/(.*)/.*#\1#' | sort | cut -c -7 | paste -s -d '-' -) |
341 | local prefix=$mark; [[ $public == 'False' ]] && prefix=p | 341 | local prefix=$mark; [[ $public == 'False' ]] && prefix=p |
342 | [[ -n $1 ]] && local index=${1} || local index=${prefix}${index} | 342 | [[ -n $1 ]] && local index=${1}; index=${prefix}${index} |
343 | eval echo $(sed -Ee 's/([^ ]+)/$\1/g' <<<"${INDEX_FORMAT[@]}") | 343 | eval echo $(sed -Ee 's/([^ ]+)/$\1/g' <<<"${INDEX_FORMAT[@]}") |
344 | done | 344 | done |
345 | } | 345 | } |
@@ -627,9 +627,9 @@ _edit_gist() { | |||
627 | 627 | ||
628 | http_data=$(mktemp) | 628 | http_data=$(mktemp) |
629 | echo '{' \"description\": \""${DESC//\"/\\\"}"\" '}' > "$http_data" | 629 | echo '{' \"description\": \""${DESC//\"/\\\"}"\" '}' > "$http_data" |
630 | new_record=$( http_method PATCH "$GITHUB_API/gists/$GIST_ID" \ | 630 | new_record=$(http_method PATCH "$GITHUB_API/gists/$GIST_ID" \ |
631 | | sed -e '1 s/^/[/; $ s/$/]/' \ | 631 | | sed -e '1 s/^/[/; $ s/$/]/' \ |
632 | | _parse_response "$1" ) | 632 | | _parse_response "${1#[[:alpha:]]}" ) |
633 | [[ -n $new_record ]] && sed -i'' -E -e "/^$1 / s^.+^$new_record^" $INDEX \ | 633 | [[ -n $new_record ]] && sed -i'' -E -e "/^$1 / s^.+^$new_record^" $INDEX \ |
634 | && hint=false mark="$1 " _show_list \ | 634 | && hint=false mark="$1 " _show_list \ |
635 | || echo 'Fail to modify gist description' | 635 | || echo 'Fail to modify gist description' |