From b83f792e4546f60f0e3c7acb13a2f9c7671cd14a Mon Sep 17 00:00:00 2001 From: typebrook Date: Fri, 31 Jan 2020 21:46:34 +0800 Subject: update --- scripts/gist | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'scripts') diff --git a/scripts/gist b/scripts/gist index c454fc7..fe38e38 100755 --- a/scripts/gist +++ b/scripts/gist @@ -15,13 +15,9 @@ # # * list your gists with format: [number] [url] [file_num] [comment_num] [short description] # gist [star | s] -# -# * clone gist repos which are not in local -# * pull master branch if a local repo is behind its remote -# gist (sync | S) # -# * Go to local gist repo -# . gist +# * show the path of local gist repo and files +# gist # # * create a new gist with files # gist (new | n) [-d | --desc ""] ... @@ -30,13 +26,13 @@ # gist (new | n) [-d | --desc ""] [-f | --file ] < # # * show the detail of a gist -# gist (detail | d) +# gist (detail | d) # # * edit a gist description -# gist (edit | e) +# gist (edit | e) # # * delete a gist -# gist (delete | D) ... +# gist (delete | D) ... # # * clean removed gists in local # gist (clean | C) @@ -59,7 +55,7 @@ # TODO test on mac and remote machine # TODO completion -# Validate configuration +# Shell configuration set -eo pipefail [ "$TRACE" ] && set -x @@ -291,8 +287,6 @@ _gist_id() { fi } -# FIXME source cause eixt -# TODO a better way without source _goto_gist() { _gist_id $1 @@ -300,17 +294,15 @@ _goto_gist() { echo 'Cloning gist as repo...' git clone git@github.com:$GIST_ID.git $folder/$GIST_ID if [[ "$?" -ne 0 ]]; then - echo 'Repo is cloned' + echo 'Repo is cloned' > /dev/tty else - echo 'Failed to clone the gist' + echo 'Failed to clone the gist' > /dev/tty fi fi - echo This gist is at $folder/$GIST_ID - echo -e "You can run the following command to jump to this directory: \n" - echo -e " \e[32m. gist $1\e[0m\n" - echo -n 'files: ' && cd $folder/$GIST_ID && ls - tig --all 2> /dev/null || true + echo $folder/$GIST_ID + cd $folder/$GIST_ID && ls + #tig --all 2> /dev/null || true } _delete_gist() { -- cgit v1.2.3-70-g09d2