mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-16 13:53:55 +00:00
fix(scripts): add missing exit after error handlers
Critical bugs where error paths print a message but don't stop execution: - install-fonts.sh: cd failure now exits properly - install-ntfy.sh: unsupported OS case now exits with error - install-git-crypt.sh: git clone and cd failures now exit properly
This commit is contained in:
@@ -21,7 +21,7 @@ clone_or_update_repo()
|
|||||||
git clone --quiet --filter=blob:none --sparse --depth=1 "$GIT_REPO" "$TMP_PATH"
|
git clone --quiet --filter=blob:none --sparse --depth=1 "$GIT_REPO" "$TMP_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "$TMP_PATH" || msgr err "No such folder $TMP_PATH"
|
cd "$TMP_PATH" || { msgr err "No such folder $TMP_PATH"; exit 1; }
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to add fonts to sparse-checkout
|
# Function to add fonts to sparse-checkout
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ if ! command -v git-crypt &> /dev/null; then
|
|||||||
rm -rf "$BUILD_PATH"
|
rm -rf "$BUILD_PATH"
|
||||||
|
|
||||||
if [ ! -d "$CHECK_PATH" ]; then
|
if [ ! -d "$CHECK_PATH" ]; then
|
||||||
git clone --depth 1 "$REPO_URL" "$BUILD_PATH" || true
|
git clone --depth 1 "$REPO_URL" "$BUILD_PATH" || { msgr err "Failed to clone $REPO_URL"; exit 1; }
|
||||||
cd "$BUILD_PATH" || msg_err "$BUILD_PATH not found"
|
cd "$BUILD_PATH" || { msgr err "$BUILD_PATH not found"; exit 1; }
|
||||||
make && make install PREFIX="$HOME/.local"
|
make && make install PREFIX="$HOME/.local"
|
||||||
else
|
else
|
||||||
msgr run_done "git-crypt ($CHECK_PATH) already installed"
|
msgr run_done "git-crypt ($CHECK_PATH) already installed"
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ case $(dfm check arch) in
|
|||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
msgr err "Unsupported OS"
|
msgr err "Unsupported OS"
|
||||||
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user