diff options
| author | typebrook <typebrook@gmail.com> | 2020-03-27 22:28:04 +0800 |
|---|---|---|
| committer | typebrook <typebrook@gmail.com> | 2020-03-27 23:35:33 +0800 |
| commit | 1fa3eff8c119f32be48540bfd2fb98983639a41a (patch) | |
| tree | c843f985e5216b13be29eacf98a7d31198d12c9c | |
| parent | 77a38c07d336cc9087e404a550f19b898d1e8b52 (diff) | |
Add alert message when index file is empty
| -rwxr-xr-x | gist | 5 |
1 files changed, 2 insertions, 3 deletions
| @@ -286,9 +286,8 @@ _index_pattern() { | |||
| 286 | # If tag=true, print tags instead or url | 286 | # If tag=true, print tags instead or url |
| 287 | # TODO color private/starred mark | 287 | # TODO color private/starred mark |
| 288 | _show_list() { | 288 | _show_list() { |
| 289 | if [[ ! -e $INDEX ]]; then | 289 | if [[ ! -s $INDEX ]]; then |
| 290 | echo 'No local file found for last update, please run command:' | 290 | echo 'Index file is empty, please run commands "gist fetch" or "gist create"' |
| 291 | echo ' gist update' | ||
| 292 | return 0 | 291 | return 0 |
| 293 | fi | 292 | fi |
| 294 | 293 | ||