bash expansion for xml linting
This commit is contained in:
parent
18088bbafd
commit
5a9b188b38
@ -152,17 +152,6 @@ important() {
|
|||||||
echo_rgb "${1}" 135 195 255
|
echo_rgb "${1}" 135 195 255
|
||||||
}
|
}
|
||||||
|
|
||||||
xml_lint_dir() {
|
|
||||||
|
|
||||||
for xml_file in "${1}"/*.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
|
|
||||||
|
|
||||||
}
|
|
||||||
start_server() {
|
start_server() {
|
||||||
local server_id
|
local server_id
|
||||||
local can_kill
|
local can_kill
|
||||||
@ -280,11 +269,13 @@ 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
|
||||||
if which xmllint >/dev/null 2>&1; then
|
if which xmllint >/dev/null 2>&1; then
|
||||||
if ! xml_lint_dir "${server_directory}"; then
|
for xml_file in "${server_directory}"/{*,"Saves"}.xml; do
|
||||||
return 1
|
log "info" "Linting $(important "${xml_file}")"
|
||||||
elif ! xml_lint_dir "${server_directory}/Saves/"; then
|
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
|
||||||
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"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user