summaryrefslogtreecommitdiffhomepage
path: root/scripts/gist
diff options
context:
space:
mode:
authortypebrook <typebrook@gmail.com>2019-12-26 14:58:33 +0800
committertypebrook <typebrook@gmail.com>2019-12-26 14:58:33 +0800
commitc64253702cf8917b38b3b23c16c4d21a788c6dd9 (patch)
treefb9b4f29397b47ae80f05dc302ebd50120ae91fb /scripts/gist
parentc232f0b4b8c1c8e0e4d9c2471d30c1a7f7c07b2e (diff)
update
Diffstat (limited to 'scripts/gist')
-rwxr-xr-xscripts/gist39
1 files changed, 38 insertions, 1 deletions
diff --git a/scripts/gist b/scripts/gist
index cde4ec7..c449e7d 100755
--- a/scripts/gist
+++ b/scripts/gist
@@ -1,9 +1,46 @@
1#!/bin/bash 1#!/usr/bin/env bash
2#
3# Author: Hsieh Chin Fan
4# License: MIT
5# https://gist.github.com/typebrook/b0d2e7e67aa50298fdf8111ae7466b56
6#
7#
8# This script host your gists as local Github repo
9# Use the following commands to manage your gists
10#
11# * update your gists list with Github API
12# gist [update | u]
13#
14# * list your gists with format: [number] [url] [file_num] [comment_num] [short description]
15# gist
16#
17# * clone gist repos which are not in local
18# gist [sync | s]
19#
20# * Go to local gist repo
21# gist <number_of_gist_in_list>
22#
23# * create a new gist with a file and description
24# gist [create | c] <filename> "<description>"
25#
26# * show the detail of a gist
27# gist [detail | d] <number_of_gist_in_list>
28#
29# * edit a gist description
30# gist [edit | e] <number_of_gist_in_list>
31#
32# * delete a gist
33# gist [delete | D] <number_of_gist_in_list>
34#
35# * clean removed gists in local
36# gist [clean | C]
2 37
3# define your environmemnts here 38# define your environmemnts here
39#-------------------
4github_api_token=$(cat $SETTING_DIR/tokens/github) 40github_api_token=$(cat $SETTING_DIR/tokens/github)
5user=typebrook 41user=typebrook
6folder=~/git/gist 42folder=~/git/gist
43#-------------------
7 44
8github_api=https://api.github.com 45github_api=https://api.github.com
9auth_header="Authorization: token $github_api_token" 46auth_header="Authorization: token $github_api_token"