diff options
author | typebrook <typebrook@gmail.com> | 2020-05-14 22:11:35 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2020-05-14 22:11:38 +0800 |
commit | 2e934ee27cfefeae343a1889306f5c329c80ea4f (patch) | |
tree | dfe029fe8177a7cd51cd0c8991c3fb7bb4677f31 | |
parent | d3a1794c6cb2b8385171ef12deac1018db28f0d5 (diff) |
Fix json processing for 'edit'v0.5
Looks like xargs cannot handle too many texts
-rwxr-xr-x | gist | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -743,7 +743,7 @@ _edit_gist() { | |||
743 | http_data=$(tmp_file) | 743 | http_data=$(tmp_file) |
744 | echo '{' \"description\": \""${DESC//\"/\\\"}"\" '}' > "$http_data" | 744 | echo '{' \"description\": \""${DESC//\"/\\\"}"\" '}' > "$http_data" |
745 | new_record=$(http_method PATCH "$GITHUB_API/gists/$GIST_ID" \ | 745 | new_record=$(http_method PATCH "$GITHUB_API/gists/$GIST_ID" \ |
746 | | xargs -I{} -0 echo "[{}]" \ | 746 | | sed -e '1 s/^/[/; $ s/$/]/' \ |
747 | | _parse_response "${index#[[:alpha:]]}" ) | 747 | | _parse_response "${index#[[:alpha:]]}" ) |
748 | [[ -n $new_record ]] && sed -i'' -E -e "/^$index / s^.+^$new_record^" $INDEX \ | 748 | [[ -n $new_record ]] && sed -i'' -E -e "/^$index / s^.+^$new_record^" $INDEX \ |
749 | && hint=false mark="$index " _show_list \ | 749 | && hint=false mark="$index " _show_list \ |