aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/gist
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gist')
-rwxr-xr-xscripts/gist10
1 files changed, 10 insertions, 0 deletions
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() {
28 cd $folder/$GIST_ID && tig --all 2> /dev/null 28 cd $folder/$GIST_ID && tig --all 2> /dev/null
29} 29}
30 30
31_delete_gist() {
32 GIST_ID=$(cat $index | sed -n "$1"p | cut -d' ' -f2 | sed -r 's#.*/##')
33 curl -X DELETE -s -H "Authorization: token $github_api_token" https://api.github.com/gists/$GIST_ID
34 _update
35}
36
31_show_detail() { 37_show_detail() {
32 GIST_ID=$(cat $index | sed -n "$1"p | cut -d' ' -f2 | sed -r 's#.*/##') 38 GIST_ID=$(cat $index | sed -n "$1"p | cut -d' ' -f2 | sed -r 's#.*/##')
33 curl -s -H "Authorization: token $github_api_token" https://api.github.com/gists/$GIST_ID 39 curl -s -H "Authorization: token $github_api_token" https://api.github.com/gists/$GIST_ID
@@ -65,6 +71,10 @@ case "$1" in
65 _show_detail $2 71 _show_detail $2
66 ;; 72 ;;
67 73
74 delete | D)
75 _delete_gist $2
76 ;;
77
68 create | c) 78 create | c)
69 _create $2 79 _create $2
70 ;; 80 ;;