Properly iterate directories
This commit is contained in:
parent
a87bea9c83
commit
c2d6438f2e
@ -269,14 +269,16 @@ start_server() {
|
|||||||
|
|
||||||
# xmllint, helps avoiding the random server launch failures for apparently no reason
|
# xmllint, helps avoiding the random server launch failures for apparently no reason
|
||||||
local lint_dirs
|
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
|
if which xmllint >/dev/null 2>&1; then
|
||||||
for xml_file in "${lint_dirs[@]}"; do
|
for dir in "${lint_dirs[@]}"; do
|
||||||
log "info" "Linting $(important "${xml_file}")"
|
for xml_file in "${dir}"/*.xml; do
|
||||||
if ! xmllint "${xml_file}" >/dev/null; then
|
log "info" "Linting $(important "${xml_file}")"
|
||||||
log "error" "Xml parsing error in $(important "${xml_file}"), resolve the error and attempt to start again"
|
if ! xmllint "${xml_file}" >/dev/null; then
|
||||||
return 1
|
log "error" "Xml parsing error in $(important "${xml_file}"), resolve the error and attempt to start again"
|
||||||
fi
|
return 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
log "warning" "$(important "xmllint") not installed or not in PATH, skipping lint check"
|
log "warning" "$(important "xmllint") not installed or not in PATH, skipping lint check"
|
||||||
|
Loading…
Reference in New Issue
Block a user