make sure existing_backups array is set in remove_expired_backups function

This commit is contained in:
Matthew Saunders Brown 2024-09-19 10:57:39 -07:00
parent 8fc3322505
commit 193bf8e7c2

View File

@ -168,6 +168,10 @@ function bashup::remove_expired_backups () {
# check for and set directory var
if [ -n "$1" ]; then
directory=$1
# make sure existing_backups array is set
if [[ -z $existing_backups ]]; then
bashup::set-existing_backups
fi
else
echo "ERROR: directory var not set"
return 1