Scripts: Remove exit stmts covered by errexit

This commit is contained in:
Unrud
2022-06-05 14:07:52 +02:00
committed by Matthias Mailänder
parent e2fd7ce7ed
commit c29f1590c9
9 changed files with 19 additions and 19 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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}" "$@"

View File

@@ -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

View File

@@ -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

View File

@@ -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() (

View File

@@ -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

View File

@@ -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