Skip to content

Commit

Permalink
update cache if older 1 day
Browse files Browse the repository at this point in the history
  • Loading branch information
ewwink authored Nov 19, 2018
1 parent 0529af4 commit d8cf4b4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ if ! [ -e "$CACHE_DIR/$FILE" ]; then
echo "-----> Fetching Latest Rclone binaries at ${DOWNLOAD_URL}" | indent
wget $DOWNLOAD_URL -q -O "$CACHE_DIR/$FILE"
else
echo "build using cached source" | indent
filestr=$(find . -name "$CACHE_DIR/$FILE" -mtime +1 -print)
if [ "$filestr" = "" ]; then
echo "-----> cache Expired, Fetching Latest Rclone at ${DOWNLOAD_URL}" | indent
wget $DOWNLOAD_URL -q -O "$CACHE_DIR/$FILE"
else
echo "build using cached source" | indent
fi
fi

cd "$BUILD_DIR"
Expand Down Expand Up @@ -118,9 +124,5 @@ if [ -f "id_rsa" ]; then
else
echo "id_rsa not exist" | indent
fi
EOF



0 comments on commit d8cf4b4

Please sign in to comment.