diff options
| author | typebrook <typebrook@gmail.com> | 2020-04-08 10:58:33 +0800 |
|---|---|---|
| committer | typebrook <typebrook@gmail.com> | 2020-04-08 10:58:33 +0800 |
| commit | e5d259070da4bc6a6bca62e814b32c73ee5417ef (patch) | |
| tree | 120ec07ba761d8ec0c00c2f3a1c9831b3ba53bd4 | |
| parent | 2ca0a674f43a18d1e52b8038513faf48ed7ace35 (diff) | |
Fix error message when index is invalid with 'gist detail'
| -rwxr-xr-x | gist | 5 |
1 files changed, 2 insertions, 3 deletions
| @@ -472,10 +472,9 @@ _gist_id() { | |||
| 472 | # set gist id either by given index or current directory | 472 | # set gist id either by given index or current directory |
| 473 | _set_gist_id() { | 473 | _set_gist_id() { |
| 474 | if [[ -z $1 ]]; then | 474 | if [[ -z $1 ]]; then |
| 475 | [[ $(dirname $(pwd)) == $folder ]] && GIST_ID=$(basename $(pwd)) || return 1 | 475 | [[ $(dirname $(pwd)) == $folder ]] && GIST_ID=$(basename $(pwd)) |
| 476 | else | ||
| 477 | _gist_id "$1" || return 1 | ||
| 478 | fi | 476 | fi |
| 477 | _gist_id "$1" || return 1 | ||
| 479 | } | 478 | } |
| 480 | 479 | ||
| 481 | # Show path of repo by gist ID, and perform action | 480 | # Show path of repo by gist ID, and perform action |