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;;