Fix file sum/name mismatch by splitting IWD into client and server parts.

master
Icedream 2019-08-29 01:03:02 +02:00
parent bb1e875abc
commit 0bec953871
Signed by: icedream
GPG Key ID: 1573F6D8EFE4D0CF
1 changed files with 34 additions and 13 deletions

View File

@ -1,16 +1,22 @@
#!/bin/bash -e
iwd_target_filename="z_svr_hns.iwd"
iwd_sv_target_filename="z_svr_hns.iwd"
iwd_cl_target_filename="hns.iwd"
if [ -z "${WORKSPACE}" ]; then
export WORKSPACE="$(pwd)"
WORKSPACE="$(pwd)"
fi
export WORKSPACE
iwd_files()
{
iwd_files() {
negate=""
if [ "$1" = "server" ]; then
negate="-not"
fi
find "${WORKSPACE}/" -type f \
! -path "*.git*" \
! -name "README*" \
! -name "LICENSE*" \
! -name "mod.*" \
! -name "_modversion.gsc" \
! -name "missingasset.csv" \
@ -20,18 +26,33 @@ iwd_files()
! -name "*.sh" \
! -name "*.bat" \
! -name "*.cmd" \
! -name "*.iwd" |\
sed "s;${WORKSPACE}/;;g"
! -name "*.iwd" \
! -name "*.str" \
-and $negate \( \
-name "*.menu" \
-or -name "*.txt" \
\) \
| sed "s;${WORKSPACE}/;;g"
}
iwd_filelist="$(mktemp)"
iwd_files > "$iwd_filelist"
iwd_cl_filelist="$(mktemp)"
iwd_sv_filelist="$(mktemp)"
echo ""
echo "== CLIENT =="
iwd_files client | tee "$iwd_cl_filelist"
echo "== SERVER =="
iwd_files server | tee "$iwd_sv_filelist"
echo ""
modversion_txt_file="maps/mp/mods/_modversion.gsc"
echo "getModVersionString(){return \"$(git describe --tags --always)\";}" > "$modversion_txt_file"
echo "$modversion_txt_file" >> "$iwd_filelist"
echo "getModVersionString(){return \"$(git describe --tags --always --dirty)\";}" > "$modversion_txt_file"
(echo "LICENSE.txt") >> "$iwd_cl_filelist"
(echo "$modversion_txt_file" && echo "LICENSE.txt") >> "$iwd_sv_filelist"
rm -f "${iwd_target_filename}"
7z a -tzip -mx9 "${iwd_target_filename}" @"$iwd_filelist"
rm -f "${iwd_sv_target_filename}" "${iwd_cl_target_filename}"
7z a -tzip -mx9 "${iwd_sv_target_filename}" @"$iwd_sv_filelist"
7z a -tzip -mx9 "${iwd_cl_target_filename}" @"$iwd_cl_filelist"
rm -f "$iwd_filelist" "$modversion_txt_file"
rm -f "$iwd_sv_filelist" "$iwd_cl_filelist"
git checkout HEAD -- $modversion_txt_file