From 80636b14c4019af1073234fb74e32fc0e08e8615 Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Sat, 14 Nov 2020 18:30:22 +0100 Subject: [PATCH] Fix some issues --- bin/update | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/update b/bin/update index fc19703..4eba293 100755 --- a/bin/update +++ b/bin/update @@ -60,7 +60,11 @@ _date_format() { _print_last_update() { if [ "$UPDATE_CHECK_TYPE" = "sliding" ]; then - date --date=@$(cat ~/.config/dotfiles/.data/update_date) +%x + if [ -s ~/.config/dotfiles/.data/update_date ]; then + date --date=@$(cat ~/.config/dotfiles/.data/update_date) +%x + else + echo never + fi else echo -e >&2 "\033[31;1merror:\033[0m last-update only available for sliding update check" fi @@ -109,7 +113,7 @@ _check_date() { local new_date=`date $1` local updated=0 - if [ "$UPDATE_CHECK_TYPE" = "sliding" ]; then + if [ -s ~/.config/dotfiles/.data/update_date ] && [ "$UPDATE_CHECK_TYPE" = "sliding" ]; then local diff=$(($new_date - $old_date)) case $UPDATE_CHECK in "daily") [ $diff -lt 86400 ] && updated=1;;