Compare commits

...

2 Commits

3 changed files with 39 additions and 13 deletions

View File

@ -1,4 +1,5 @@
@echo off & setlocal @echo off & setlocal
cd %~dp0
pushd ..\.. pushd ..\..
iw4x -zonebuilder +set fs_game "mods\Hide and Seek v2" +buildzone "..\mods\Hide and Seek v2\mod" +quit iw4x -zonebuilder +set fs_game "mods\Hide and Seek v2" +buildzone "..\mods\Hide and Seek v2\mod" +quit
popd popd

4
build_iwd.cmd Normal file
View File

@ -0,0 +1,4 @@
@echo off & setlocal
cd %~dp0
git-bash ./build_iwd.sh
endlocal

View File

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