From c2d6438f2eead1934a30e2d82a1c37a8b0357589 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sat, 1 Jan 2022 03:11:17 -0600 Subject: [PATCH] Properly iterate directories --- Scripts/7D2D-Manage.bash | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Scripts/7D2D-Manage.bash b/Scripts/7D2D-Manage.bash index f6d33d5..ac8e22d 100644 --- a/Scripts/7D2D-Manage.bash +++ b/Scripts/7D2D-Manage.bash @@ -269,14 +269,16 @@ start_server() { # xmllint, helps avoiding the random server launch failures for apparently no reason local lint_dirs - lint_dirs=("${server_directory}"/*.xml "${server_directory}/Saves"/*.xml) + lint_dirs=("${server_directory}" "${server_directory}/Saves") if which xmllint >/dev/null 2>&1; then - for xml_file in "${lint_dirs[@]}"; do - log "info" "Linting $(important "${xml_file}")" - if ! xmllint "${xml_file}" >/dev/null; then - log "error" "Xml parsing error in $(important "${xml_file}"), resolve the error and attempt to start again" - return 1 - fi + for dir in "${lint_dirs[@]}"; do + for xml_file in "${dir}"/*.xml; do + log "info" "Linting $(important "${xml_file}")" + if ! xmllint "${xml_file}" >/dev/null; then + log "error" "Xml parsing error in $(important "${xml_file}"), resolve the error and attempt to start again" + return 1 + fi + done done else log "warning" "$(important "xmllint") not installed or not in PATH, skipping lint check"