Fix some issues

This commit is contained in:
Thomas Forgione 2020-11-14 18:30:22 +01:00
parent e926bdf95c
commit 80636b14c4
1 changed files with 6 additions and 2 deletions

View File

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