From 52e5a9e60cf0271ff4907fe50169ce318ee2ca0c Mon Sep 17 00:00:00 2001 From: typebrook Date: Tue, 24 Dec 2019 13:27:19 +0800 Subject: update --- scripts/gist/gist | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'scripts/gist') 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 @@ github_api_token=$(cat $SETTING_DIR/tokens/github) user=typebrook folder=~/git/gist +custom_action='cd $folder/$GIST_ID && tig --all' mkdir -p $folder index=$folder/index -custom_action='tig --all' - function _update() { # get the list of gists curl -s -H "Authorization: OAuth $github_api_token" https://api.github.com/users/$user/gists |\ @@ -26,8 +25,7 @@ function _update() { function _go_to_gist() { GIST_ID=$(cat $index | sed -n "$1"p | cut -d' ' -f2 | sed -r 's#.*/##') - cd $folder/$GIST_ID - eval $custom_action + eval $custom_action &> /dev/null || echo this gist is at $folder/$GIST_ID } if [[ $# -eq 0 ]]; then -- cgit v1.2.3-70-g09d2