diff options
| -rw-r--r-- | alias | 2 | ||||
| -rwxr-xr-x | scripts/gist | 6 |
2 files changed, 4 insertions, 4 deletions
| @@ -29,7 +29,7 @@ fix() { | |||
| 29 | ( which $1 ) && grep -Po 'FIXME.*' $(which $1) | 29 | ( which $1 ) && grep -Po 'FIXME.*' $(which $1) |
| 30 | } | 30 | } |
| 31 | gicd() { | 31 | gicd() { |
| 32 | dir=$(gist $1 | tee /dev/tty | head -1) | 32 | dir=$(gist $1 --no-action) |
| 33 | [[ -d $dir ]] && cd $dir | 33 | [[ -d $dir ]] && cd $dir |
| 34 | } | 34 | } |
| 35 | 35 | ||
diff --git a/scripts/gist b/scripts/gist index 20e8f06..ef1e5e2 100755 --- a/scripts/gist +++ b/scripts/gist | |||
| @@ -11,7 +11,7 @@ | |||
| 11 | # [star | s] list your gists with format below, star for your starred gists: | 11 | # [star | s] list your gists with format below, star for your starred gists: |
| 12 | # [index_of_gist] [url] [file_num] [comment_num] [short description] | 12 | # [index_of_gist] [url] [file_num] [comment_num] [short description] |
| 13 | # update, u [star | s] update the local list of your gists, star for your starred gists | 13 | # update, u [star | s] update the local list of your gists, star for your starred gists |
| 14 | # <index_of_gist> show the path of local gist repo and do custom actions | 14 | # <index_of_gist> [--no-action] show the path of local gist repo and do custom actions |
| 15 | # new, n [-d | --desc <description>] <files>... create a new gist with files | 15 | # new, n [-d | --desc <description>] <files>... create a new gist with files |
| 16 | # new, n [-d | --desc <description>] [-f | --file <file_name>] create a new gist from STDIN | 16 | # new, n [-d | --desc <description>] [-f | --file <file_name>] create a new gist from STDIN |
| 17 | # detail, d <index_of_gist> show the detail of a gist | 17 | # detail, d <index_of_gist> show the detail of a gist |
| @@ -301,7 +301,7 @@ _goto_gist() { | |||
| 301 | fi | 301 | fi |
| 302 | fi | 302 | fi |
| 303 | 303 | ||
| 304 | (cd $folder/$GIST_ID && eval "$action") | 304 | [[ $2 != '--no-action' ]] && cd $folder/$GIST_ID && eval "$action" |
| 305 | echo $folder/$GIST_ID | 305 | echo $folder/$GIST_ID |
| 306 | } | 306 | } |
| 307 | 307 | ||
| @@ -480,5 +480,5 @@ case "$1" in | |||
| 480 | help | h) | 480 | help | h) |
| 481 | usage ;; | 481 | usage ;; |
| 482 | *) | 482 | *) |
| 483 | _goto_gist "$1" ;; | 483 | _goto_gist "$@" ;; |
| 484 | esac | 484 | esac |