2016-04-12 21:58:03 +00:00
|
|
|
#!/bin/bash -e
|
2018-03-29 22:44:08 +00:00
|
|
|
|
2019-08-28 23:03:02 +00:00
|
|
|
iwd_sv_target_filename="z_svr_hns.iwd"
|
|
|
|
iwd_cl_target_filename="hns.iwd"
|
2018-03-29 22:44:08 +00:00
|
|
|
|
2016-04-07 16:56:36 +00:00
|
|
|
if [ -z "${WORKSPACE}" ]; then
|
2019-08-28 23:03:02 +00:00
|
|
|
WORKSPACE="$(pwd)"
|
2016-04-07 15:40:43 +00:00
|
|
|
fi
|
2019-08-28 23:03:02 +00:00
|
|
|
export WORKSPACE
|
2016-04-07 15:40:43 +00:00
|
|
|
|
2019-08-28 23:03:02 +00:00
|
|
|
iwd_files() {
|
|
|
|
negate=""
|
|
|
|
if [ "$1" = "server" ]; then
|
|
|
|
negate="-not"
|
|
|
|
fi
|
2016-04-07 15:40:43 +00:00
|
|
|
find "${WORKSPACE}/" -type f \
|
|
|
|
! -path "*.git*" \
|
|
|
|
! -name "README*" \
|
2019-08-28 23:03:02 +00:00
|
|
|
! -name "LICENSE*" \
|
2016-04-12 23:19:34 +00:00
|
|
|
! -name "mod.*" \
|
|
|
|
! -name "_modversion.gsc" \
|
2016-04-07 15:40:43 +00:00
|
|
|
! -name "missingasset.csv" \
|
|
|
|
! -name "*.md" \
|
|
|
|
! -name "*.log*" \
|
|
|
|
! -path "*/demos/**" \
|
|
|
|
! -name "*.sh" \
|
2018-03-30 00:42:28 +00:00
|
|
|
! -name "*.bat" \
|
|
|
|
! -name "*.cmd" \
|
2019-08-28 23:03:02 +00:00
|
|
|
! -name "*.iwd" \
|
|
|
|
! -name "*.str" \
|
|
|
|
-and $negate \( \
|
|
|
|
-name "*.menu" \
|
|
|
|
-or -name "*.txt" \
|
|
|
|
\) \
|
|
|
|
| sed "s;${WORKSPACE}/;;g"
|
2016-04-07 15:40:43 +00:00
|
|
|
}
|
|
|
|
|
2019-08-28 23:03:02 +00:00
|
|
|
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 ""
|
2016-04-12 21:58:03 +00:00
|
|
|
|
2016-04-12 23:19:34 +00:00
|
|
|
modversion_txt_file="maps/mp/mods/_modversion.gsc"
|
2019-08-28 23:03:02 +00:00
|
|
|
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"
|
2016-04-07 15:40:43 +00:00
|
|
|
|
2019-08-28 23:03:02 +00:00
|
|
|
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"
|
2016-04-12 21:58:03 +00:00
|
|
|
|
2019-08-28 23:03:02 +00:00
|
|
|
rm -f "$iwd_sv_filelist" "$iwd_cl_filelist"
|
|
|
|
git checkout HEAD -- $modversion_txt_file
|