From 875d5aa6d5789717ea5c02e4025bd398f248713d Mon Sep 17 00:00:00 2001 From: Kai Krakow Date: Thu, 19 Dec 2024 23:09:08 +0100 Subject: [PATCH] xpadneo, installer: Exit immediately on error Fixes a problem where the installer would not exit if the git clone is not properly set up. Link: https://github.com/atar-axis/xpadneo/issues/491#issuecomment-2553070910 Signed-off-by: Kai Krakow --- install.sh | 6 +++--- uninstall.sh | 7 ++++--- update.sh | 4 +++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index 6af51f29..bd4127f3 100755 --- a/install.sh +++ b/install.sh @@ -1,6 +1,8 @@ #!/bin/bash -cd "$(dirname "$0")" || exit 1 +set -e + +cd "$(dirname "$0")" source "lib/options.sh" source "lib/installer.sh" @@ -12,8 +14,6 @@ fi if [[ -z "${INSTALLED[*]}" ]]; then - set -e - echo "* creating dkms.conf" sed 's/"@DO_NOT_CHANGE@"/"'"${VERSION}"'"/g' hid-xpadneo/dkms.conf diff --git a/uninstall.sh b/uninstall.sh index 2910235f..8d3d62ac 100755 --- a/uninstall.sh +++ b/uninstall.sh @@ -1,6 +1,8 @@ #!/bin/bash -cd "$(dirname "$0")" || exit 1 +set -e + +cd "$(dirname "$0")" source "lib/options.sh" source "lib/installer.sh" @@ -10,8 +12,7 @@ modprobe -r hid_xpadneo || true echo "* looking for registered instances" echo "found ${#INSTALLED[@]} registered instance(s) on your system" -set -e - +# NOTE: overrides VERSION from lib/installer.sh but we don't need it for VERSION in "${INSTALLED[@]}"; do echo "* ${VERSION}" diff --git a/update.sh b/update.sh index 7e613789..067e24bc 100755 --- a/update.sh +++ b/update.sh @@ -1,6 +1,8 @@ #!/bin/bash -cd "$(dirname "$0")" || exit 1 +set -e + +cd "$(dirname "$0")" source "lib/installer.sh" LATEST=$(get_upstream_version_latest)