From 2e934ee27cfefeae343a1889306f5c329c80ea4f Mon Sep 17 00:00:00 2001 From: typebrook Date: Thu, 14 May 2020 22:11:35 +0800 Subject: Fix json processing for 'edit' Looks like xargs cannot handle too many texts --- gist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gist b/gist index e5808d2..752c7db 100755 --- a/gist +++ b/gist @@ -743,7 +743,7 @@ _edit_gist() { http_data=$(tmp_file) echo '{' \"description\": \""${DESC//\"/\\\"}"\" '}' > "$http_data" new_record=$(http_method PATCH "$GITHUB_API/gists/$GIST_ID" \ - | xargs -I{} -0 echo "[{}]" \ + | sed -e '1 s/^/[/; $ s/$/]/' \ | _parse_response "${index#[[:alpha:]]}" ) [[ -n $new_record ]] && sed -i'' -E -e "/^$index / s^.+^$new_record^" $INDEX \ && hint=false mark="$index " _show_list \ -- cgit v1.2.3-70-g09d2