fix(backups): backup config folder only if it exists

Signed-off-by: Dominik Willner <th33xitus@gmail.com>
This commit is contained in:
dw-0
2024-03-24 19:45:02 +01:00
parent b6c6edb622
commit d800d356ca

View File

@@ -43,6 +43,7 @@ function backup_config_dir() {
local i=0 folder folder_name target_dir
for folder in ${config_pathes}; do
if [[ -d ${folder} ]]; then
status_msg "Create backup of ${folder} ..."
folder_name=$(echo "${folder}" | rev | cut -d"/" -f2 | rev)
@@ -52,6 +53,7 @@ function backup_config_dir() {
i=$(( i + 1 ))
ok_msg "Backup created in:\n${target_dir}"
fi
done
else
ok_msg "No config directory found! Skipping backup ..."