summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2020-02-05 08:50:01 +0800
committertypebrook <typebrook@gmail.com>2020-02-05 08:50:01 +0800
commitf53d2965018fc033fcf29f0ef81044fe9d0799c7 (patch)
tree3b05da2b48fcc7ea05270a00c345fd88b205b928
parent1c5ae79e7304a662d530cf6eb2ae7a5e05d05c32 (diff)
update
-rwxr-xr-xscripts/gist8
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/gist b/scripts/gist
index e9e5130..b0fc6b6 100755
--- a/scripts/gist
+++ b/scripts/gist
@@ -187,7 +187,7 @@ _show_list() {
187 echo -e $index $link $author $file_num $extra $(echo $description | cut -c -$(( 60 -$occupy -1 )) ) 187 echo -e $index $link $author $file_num $extra $(echo $description | cut -c -$(( 60 -$occupy -1 )) )
188 done < $INDEX \ 188 done < $INDEX \
189 | sed "$filter" 189 | sed "$filter"
190 echo -e '\nrun "gist help" for more details' 190 echo -e '\nrun "gist help" for more details' > /dev/null
191} 191}
192 192
193# parse JSON from STDIN with string of commands 193# parse JSON from STDIN with string of commands
@@ -441,8 +441,10 @@ _edit_gist() {
441 441
442 echo -n 'Type new description: ' 442 echo -n 'Type new description: '
443 read DESC < /dev/tty 443 read DESC < /dev/tty
444 echo "{ \"description\": \"$DESC\" }" \ 444
445 | http_method PATCH $GITHUB_API/gists/$GIST_ID > /dev/null \ 445 http_data=$(mktemp)
446 echo "{ \"description\": \"$DESC\" }" > $http_data
447 http_method PATCH $http_data $GITHUB_API/gists/$GIST_ID > /dev/null \
446 && _update 448 && _update
447} 449}
448 450