#!/bin/bash -e if [ -z "${WORKSPACE}" ]; then export WORKSPACE="$(pwd)" fi iwd_files() { find "${WORKSPACE}/" -type f \ ! -path "*.git*" \ ! -name "README*" \ ! -name "mod.*" \ ! -name "_modversion.gsc" \ ! -name "missingasset.csv" \ ! -name "*.md" \ ! -name "*.log*" \ ! -path "*/demos/**" \ ! -name "*.sh" \ ! -name "*.iwd" |\ sed "s;${WORKSPACE}/;;g" } iwd_filelist="$(mktemp)" iwd_files > "$iwd_filelist" modversion_txt_file="maps/mp/mods/_modversion.gsc" echo "getModVersionString(){return \"$(git describe --tags --always --dirty)\";}" > "$modversion_txt_file" echo "$modversion_txt_file" >> "$iwd_filelist" rm -f "hns.iwd" 7z a -tzip -mx9 "hns.iwd" @"$iwd_filelist" rm -f "$iwd_filelist" "$modversion_txt_file"