From 1fa3eff8c119f32be48540bfd2fb98983639a41a Mon Sep 17 00:00:00 2001 From: typebrook Date: Fri, 27 Mar 2020 22:28:04 +0800 Subject: Add alert message when index file is empty --- gist | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gist b/gist index 789ef85..cc41f60 100755 --- a/gist +++ b/gist @@ -286,9 +286,8 @@ _index_pattern() { # If tag=true, print tags instead or url # TODO color private/starred mark _show_list() { - if [[ ! -e $INDEX ]]; then - echo 'No local file found for last update, please run command:' - echo ' gist update' + if [[ ! -s $INDEX ]]; then + echo 'Index file is empty, please run commands "gist fetch" or "gist create"' return 0 fi -- cgit v1.2.3-70-g09d2