diff --git a/fetch-geoip.sh b/fetch-geoip.sh index 482b4ea5b0..2e12127767 100755 --- a/fetch-geoip.sh +++ b/fetch-geoip.sh @@ -10,7 +10,7 @@ set -o errexit || exit $? # Set the working directory to the location of this script HERE=$(dirname "$0") -cd "${HERE}" || exit 1 +cd "${HERE}" # Database does not exist or is older than 30 days. if [ -z "$(find . -path ./IP2LOCATION-LITE-DB1.IPV6.BIN.ZIP -mtime -30 -print)" ]; then diff --git a/packaging/functions.sh b/packaging/functions.sh index 3c2e27c0a2..5ae2e73b6d 100755 --- a/packaging/functions.sh +++ b/packaging/functions.sh @@ -35,7 +35,7 @@ install_assemblies() ( COPY_D2K_DLL="${7}" ORIG_PWD=$(pwd) - cd "${SRC_PATH}" || exit 1 + cd "${SRC_PATH}" if [ "${RUNTIME}" = "mono" ]; then echo "Building assemblies" @@ -59,7 +59,7 @@ install_assemblies() ( rm "${SRC_PATH}/bin/OpenRA.Mods.D2k.dll" fi - cd "${ORIG_PWD}" || exit 1 + cd "${ORIG_PWD}" echo "Installing engine to ${DEST_PATH}" install -d "${DEST_PATH}" @@ -82,7 +82,7 @@ install_assemblies() ( else dotnet publish -c Release -p:TargetPlatform="${TARGETPLATFORM}" -p:CopyGenericLauncher="${COPY_GENERIC_LAUNCHER}" -p:CopyCncDll="${COPY_CNC_DLL}" -p:CopyD2kDll="${COPY_D2K_DLL}" -r "${TARGETPLATFORM}" -o "${DEST_PATH}" --self-contained true fi - cd "${ORIG_PWD}" || exit 1 + cd "${ORIG_PWD}" ) # Copy the core engine and specified mod data to the target directory diff --git a/packaging/linux/buildpackage.sh b/packaging/linux/buildpackage.sh index 1c4f03da46..89c10e0240 100755 --- a/packaging/linux/buildpackage.sh +++ b/packaging/linux/buildpackage.sh @@ -15,7 +15,7 @@ fi # Set the working dir to the location of this script HERE=$(dirname "$0") -cd "${HERE}" || exit 1 +cd "${HERE}" . ../functions.sh TAG="$1" @@ -36,7 +36,7 @@ elif [[ ${TAG} == pkgtest* ]]; then SUFFIX="-pkgtest" fi -pushd "${TEMPLATE_ROOT}" > /dev/null || exit 1 +pushd "${TEMPLATE_ROOT}" > /dev/null if [ ! -d "${OUTPUTDIR}" ]; then echo "Output directory '${OUTPUTDIR}' does not exist."; @@ -46,9 +46,9 @@ fi # Add native libraries echo "Downloading appimagetool" if command -v curl >/dev/null 2>&1; then - curl -s -L -O https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage || exit 3 + curl -s -L -O https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage else - wget -cq https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage || exit 3 + wget -cq https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage fi chmod a+x appimagetool-x86_64.AppImage diff --git a/packaging/linux/openra-server.appimage.in b/packaging/linux/openra-server.appimage.in index 037c07c7df..50ccfe591f 100755 --- a/packaging/linux/openra-server.appimage.in +++ b/packaging/linux/openra-server.appimage.in @@ -3,6 +3,6 @@ set -o errexit || exit $? LAUNCHER=$(readlink -f "${0}") HERE=$(dirname "${LAUNCHER}") -cd "${HERE}/../lib/openra" || exit 1 +cd "${HERE}/../lib/openra" ./OpenRA.Server Game.Mod="{MODID}" "$@" diff --git a/packaging/linux/openra.appimage.in b/packaging/linux/openra.appimage.in index 0254030737..ff21037dce 100755 --- a/packaging/linux/openra.appimage.in +++ b/packaging/linux/openra.appimage.in @@ -3,7 +3,7 @@ set -o errexit || exit $? LAUNCHER=$(readlink -f "${0}") HERE="$(dirname "${LAUNCHER}")" -cd "${HERE}/../lib/openra" || exit 1 +cd "${HERE}/../lib/openra" # APPIMAGE is an environment variable set by the runtime # defining the absolute path to the .AppImage file diff --git a/packaging/macos/buildpackage.sh b/packaging/macos/buildpackage.sh index 3eded8c958..b6fd8fdde5 100755 --- a/packaging/macos/buildpackage.sh +++ b/packaging/macos/buildpackage.sh @@ -30,7 +30,7 @@ fi # Set the working dir to the location of this script HERE=$(dirname "${0}") -cd "${HERE}" || exit 1 +cd "${HERE}" . ../functions.sh # Import code signing certificate diff --git a/packaging/package-all.sh b/packaging/package-all.sh index 4f57b00d9a..4a31e04634 100755 --- a/packaging/package-all.sh +++ b/packaging/package-all.sh @@ -12,7 +12,7 @@ export GIT_TAG="$1" export BUILD_OUTPUT_DIR="$2" # Set the working dir to the location of this script using bash parameter expansion -cd "${0%/*}" || exit 1 +cd "${0%/*}" #build packages using a subshell so directory changes do not persist beyond the function function build_package() ( diff --git a/packaging/source/buildpackage.sh b/packaging/source/buildpackage.sh index 18168adac1..1327376b81 100755 --- a/packaging/source/buildpackage.sh +++ b/packaging/source/buildpackage.sh @@ -10,13 +10,13 @@ fi # Set the working dir to the location of this script HERE=$(dirname "$0") -cd "${HERE}" || exit 1 +cd "${HERE}" TAG="$1" OUTPUTDIR="$2" SRCDIR="$(pwd)/../.." -pushd "${SRCDIR}" > /dev/null || exit 1 +pushd "${SRCDIR}" > /dev/null make version VERSION="${TAG}" # The output from `git ls-tree` is too long to fit in a single command (overflows MAX_ARG_STRLEN) @@ -26,4 +26,4 @@ rm "${OUTPUTDIR}/OpenRA-${TAG}-source.tar" || : git ls-tree HEAD --name-only -r -z | xargs -0 tar vrf "${OUTPUTDIR}/OpenRA-${TAG}-source.tar" bzip2 "${OUTPUTDIR}/OpenRA-${TAG}-source.tar" -popd > /dev/null || exit 1 +popd > /dev/null diff --git a/packaging/windows/buildpackage.sh b/packaging/windows/buildpackage.sh index b11fc3c13b..95cf89ec3d 100755 --- a/packaging/windows/buildpackage.sh +++ b/packaging/windows/buildpackage.sh @@ -16,7 +16,7 @@ fi # Set the working dir to the location of this script HERE=$(dirname "$0") -cd "${HERE}" || exit 1 +cd "${HERE}" . ../functions.sh TAG="$1" @@ -35,9 +35,9 @@ elif [[ ${TAG} == playtest* ]]; then fi if command -v curl >/dev/null 2>&1; then - curl -s -L -O https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe || exit 3 + curl -s -L -O https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe else - wget -cq https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe || exit 3 + wget -cq https://github.com/electron/rcedit/releases/download/v1.1.1/rcedit-x64.exe fi function makelauncher() @@ -75,7 +75,7 @@ function build_platform() makelauncher "Dune2000" "Dune 2000" "d2k" "${PLATFORM}" echo "Building Windows setup.exe ($1)" - makensis -V2 -DSRCDIR="${BUILTDIR}" -DTAG="${TAG}" -DSUFFIX="${SUFFIX}" -DOUTFILE="${OUTPUTDIR}/OpenRA-${TAG}-${PLATFORM}.exe" ${USE_PROGRAMFILES32} OpenRA.nsi || exit 1 + makensis -V2 -DSRCDIR="${BUILTDIR}" -DTAG="${TAG}" -DSUFFIX="${SUFFIX}" -DOUTFILE="${OUTPUTDIR}/OpenRA-${TAG}-${PLATFORM}.exe" ${USE_PROGRAMFILES32} OpenRA.nsi echo "Packaging zip archive ($1)" pushd "${BUILTDIR}" > /dev/null