From 212da43d0a7cb4b2d56348472f7e4048a9842d0e Mon Sep 17 00:00:00 2001 From: Daniel Ceregatti Date: Tue, 5 Sep 2023 17:35:17 -0700 Subject: [PATCH] Add support for processing local XML files, as some times mods include them. Add DayZ Bicycle XML integration. Update docs. --- README.md | 2 +- files/bin/xml.sh | 12 ++++++++++-- files/mods/2971190303/xml.env | 6 ++++++ files/mods/@DayZBicycle | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 files/mods/2971190303/xml.env create mode 120000 files/mods/@DayZBicycle diff --git a/README.md b/README.md index c21b720..1c83a8e 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ Install the mpmissions files for the map(s) you plan to run. By default, only Ch ```shell # Copy Chernarus cp -a /mpmission/dayzOffline.chernarusplus ${MPMISSIONS} -# Copy Livonia +# And/Or copy Livonia cp -a /mpmission/dayzOffline.enoch ${MPMISSIONS} ``` diff --git a/files/bin/xml.sh b/files/bin/xml.sh index 6b50a0c..c28193b 100755 --- a/files/bin/xml.sh +++ b/files/bin/xml.sh @@ -12,11 +12,19 @@ source ${FILES}/mods/${ID}/xml.env # Iterate over the file names we can handle for var in CFGEVENTSPAWNS CFGSPAWNABLETYPES EVENTS TYPES do - if echo ${!var} | grep -q http + DIR="${WORKSHOP_DIR}/${ID}" + OUT="${DIR}/${var,,}.xml" + if echo ${!var} | grep -qE "^http" then - OUT="${WORKSHOP_DIR}/${ID}/${var,,}.xml" echo "${var} is a URL, downloading to ${OUT}" curl -so ${OUT} ${!var} + elif echo ${!var} | grep -qE "^\./" + then + echo "${var} is local, copying to ${OUT}" + cp -v "${DIR}/${!var}" "${OUT}" + fi + if [ -f ${OUT} ] + then xmllint --noout ${OUT} 2> /dev/null || { echo -e "${red}${var,,}.xml does not pass XML lint test!${default}" } && { diff --git a/files/mods/2971190303/xml.env b/files/mods/2971190303/xml.env new file mode 100644 index 0000000..83ed28a --- /dev/null +++ b/files/mods/2971190303/xml.env @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +CFGSPAWNABLETYPES=./spawnabletypes.xml +CFGEVENTSPAWNS=./cfgeventspawns_chernarus.xml +#EVENTS=events.xml +#TYPES=types.xml diff --git a/files/mods/@DayZBicycle b/files/mods/@DayZBicycle new file mode 120000 index 0000000..dc05f69 --- /dev/null +++ b/files/mods/@DayZBicycle @@ -0,0 +1 @@ +2971190303 \ No newline at end of file