From d6be8f8ec764229583f2e99fb36f334435453419 Mon Sep 17 00:00:00 2001 From: typebrook Date: Tue, 24 Dec 2019 16:37:24 +0800 Subject: update --- scripts/gist | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts/gist') diff --git a/scripts/gist b/scripts/gist index 879bc3d..ffc479f 100755 --- a/scripts/gist +++ b/scripts/gist @@ -28,6 +28,12 @@ _go_to_gist() { cd $folder/$GIST_ID && tig --all 2> /dev/null } +_delete_gist() { + GIST_ID=$(cat $index | sed -n "$1"p | cut -d' ' -f2 | sed -r 's#.*/##') + curl -X DELETE -s -H "Authorization: token $github_api_token" https://api.github.com/gists/$GIST_ID + _update +} + _show_detail() { GIST_ID=$(cat $index | sed -n "$1"p | cut -d' ' -f2 | sed -r 's#.*/##') curl -s -H "Authorization: token $github_api_token" https://api.github.com/gists/$GIST_ID @@ -65,6 +71,10 @@ case "$1" in _show_detail $2 ;; + delete | D) + _delete_gist $2 + ;; + create | c) _create $2 ;; -- cgit v1.2.3-70-g09d2