Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Commit

Permalink
check if cache file exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Hartmann committed Apr 10, 2017
1 parent b549d59 commit 661c707
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ fetch_list() {
}

fetch_gists() {
local CACHING_TIME=$(filemtime $GIST_CACHE_ALL)
if [ -f $GIST_CACHE_ALL ]; then
local CACHING_TIME=$(filemtime $GIST_CACHE_ALL)
else
local CACHING_TIME=0
fi

if [ $CACHING_TIME != 0 ] && [ $CACHING_TIME -gt 1800 ]; then
cat $GIST_CACHE_ALL
Expand Down

0 comments on commit 661c707

Please sign in to comment.