aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-05-14 22:11:35 +0800
committertypebrook <typebrook@gmail.com>2020-05-14 22:11:38 +0800
commit2e934ee27cfefeae343a1889306f5c329c80ea4f (patch)
treedfe029fe8177a7cd51cd0c8991c3fb7bb4677f31
parentd3a1794c6cb2b8385171ef12deac1018db28f0d5 (diff)
Fix json processing for 'edit'v0.5
Looks like xargs cannot handle too many texts
-rwxr-xr-xgist2
1 files changed, 1 insertions, 1 deletions
diff --git a/gist b/gist
index e5808d2..752c7db 100755
--- a/gist
+++ b/gist
@@ -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 \