From 716c274f53e42205da05d0957b5788afc48ff228 Mon Sep 17 00:00:00 2001 From: typebrook Date: Mon, 30 Mar 2020 13:00:27 +0800 Subject: Add hint for mtime of INDEX file --- gist | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gist b/gist index 0e16187..d61f86b 100755 --- a/gist +++ b/gist @@ -319,7 +319,9 @@ _show_list() { echo > /dev/tty echo Pinned tags: "${pinned_tags[*]/#/#} " > /dev/tty elif [[ -z $INPUT && $hint == 'true' ]]; then + local mtime="$(stat -c %y $INDEX | cut -d'.' -f1)" echo > /dev/tty + echo "Last updated at $mtime" > /dev/tty echo 'Run "gist fetch" to keep gists up to date, or "gist help" for more details' > /dev/tty fi } @@ -571,7 +573,7 @@ _push_to_remote() { git add . && git commit -m 'update' fi if [[ -n $(git cherry) ]]; then - git push origin master && (_fetch_gists &> /dev/null &) + git push origin master && (hint=false _fetch_gists &> /dev/null &) fi } -- cgit v1.2.3-70-g09d2