1 changed file
lib | ||
utils.sh | ||
Add comment 528 ! type trap_function &>/dev/null &&
Add comment 529 type docker_image_cleanup &>/dev/null; then
Add comment 530 trap_function(){
Add comment 531 Plus # shellcheck disable=SC2317
Add comment 531 532 docker_image_cleanup
Add comment 532 533 }
Add comment 533 534 fi
Add comment 1425 1426 return 1
Add comment 1426 1427 elif find "$file" -mtime -"$days" -print | grep -q .; then
Add comment 1427 1428 return 0
Add comment 1428 Minus elif [ "$(stat -c '%Y' "$file")" -ge "$(date -d "$days days ago" '+%s')" ]; then
Add comment 1429 Plus else
Add comment 1430 Plus local days_ago_in_seconds
Add comment 1431 Plus days_ago_in_seconds="$(date -d "$days days ago" '+%s')"
Add comment 1432 Plus if is_mac; then
Add comment 1433 Plus if [ "$(stat -f '%m' "$file")" -ge "$days_ago_in_seconds" ]; then
Add comment 1429 1434 return 0
Add comment 1435 Plus else
Add comment 1436 Plus return 1
Add comment 1430 1437 fi
Add comment 1438 Plus elif [ "$(stat -c '%Y' "$file")" -ge "$days_ago_in_seconds" ]; then
Add comment 1439 Plus return 0
Add comment 1440 Plus else
Add comment 1431 1441 return 1
Add comment 1442 Plus fi
Add comment 1443 Plus fi
Add comment 1432 1444 }
Add comment 1433 1445