aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xscripts/gist/gist6
1 files changed, 2 insertions, 4 deletions
diff --git a/scripts/gist/gist b/scripts/gist/gist
index dfe7a50..79d028f 100755
--- a/scripts/gist/gist
+++ b/scripts/gist/gist
@@ -3,12 +3,11 @@
3github_api_token=$(cat $SETTING_DIR/tokens/github) 3github_api_token=$(cat $SETTING_DIR/tokens/github)
4user=typebrook 4user=typebrook
5folder=~/git/gist 5folder=~/git/gist
6custom_action='cd $folder/$GIST_ID && tig --all'
6 7
7mkdir -p $folder 8mkdir -p $folder
8index=$folder/index 9index=$folder/index
9 10
10custom_action='tig --all'
11
12function _update() { 11function _update() {
13 # get the list of gists 12 # get the list of gists
14 curl -s -H "Authorization: OAuth $github_api_token" https://api.github.com/users/$user/gists |\ 13 curl -s -H "Authorization: OAuth $github_api_token" https://api.github.com/users/$user/gists |\
@@ -26,8 +25,7 @@ function _update() {
26 25
27function _go_to_gist() { 26function _go_to_gist() {
28 GIST_ID=$(cat $index | sed -n "$1"p | cut -d' ' -f2 | sed -r 's#.*/##') 27 GIST_ID=$(cat $index | sed -n "$1"p | cut -d' ' -f2 | sed -r 's#.*/##')
29 cd $folder/$GIST_ID 28 eval $custom_action &> /dev/null || echo this gist is at $folder/$GIST_ID
30 eval $custom_action
31} 29}
32 30
33if [[ $# -eq 0 ]]; then 31if [[ $# -eq 0 ]]; then