Files
OpenRA/packaging/package-all.sh
Unrud b1ffe0edd5 Don't use parameter expansion for paths
It fails when the script is started with `bash package-all.sh`.
2022-12-31 16:20:55 +01:00

39 lines
842 B
Bash
Executable File

#!/bin/bash
# OpenRA master packaging script
set -o errexit -o pipefail || exit $?
if [ $# -ne "2" ]; then
echo "Usage: $(basename "$0") version outputdir."
exit 1
fi
export GIT_TAG="$1"
export BUILD_OUTPUT_DIR="$2"
# Set the working dir to the location of this script
HERE=$(dirname "$0")
cd "${HERE}"
#build packages using a subshell so directory changes do not persist beyond the function
function build_package() (
function on_build() {
echo "$1 package build failed." 1>&2
}
#trap function executes on any error in the following commands
trap "on_build $1" ERR
echo "Building $1 package(s)."
cd "$1"
./buildpackage.sh "${GIT_TAG}" "${BUILD_OUTPUT_DIR}"
)
if [[ "$OSTYPE" == "darwin"* ]]; then
build_package macos
else
build_package windows
build_package linux
build_package source
fi
echo "Package build done."