Improve update error catching

This commit is contained in:
Ryan Hughes
2025-10-23 21:33:23 -04:00
parent 50e68f466e
commit 413d292f2a
5 changed files with 11 additions and 1 deletions

View File

@@ -1,5 +1,7 @@
#!/bin/bash
set -e
if [[ $# -lt 1 ]]; then
echo "Usage: omarchy-hook [name] [args...]"
exit 1

View File

@@ -1,5 +1,7 @@
#!/bin/bash
set -e
COMMAND="$1"
OMARCHY_PATH=${OMARCHY_PATH:-$HOME/.local/share/omarchy}
@@ -17,7 +19,7 @@ create)
DESC="$(omarchy-version)"
echo -e "\e[32mCreate system snapshot\e[0m"
# Get existing snapper config names from CSV output
mapfile -t CONFIGS < <(sudo snapper --csvout list-configs | awk -F, 'NR>1 {print $1}')

View File

@@ -2,6 +2,8 @@
set -e
trap 'echo ""; echo -e "\033[0;31mSomething went wrong during the update!\n\nPlease review the output above carefully, correct the error, and retry the update.\n\nIf you need assistance, get help from the community at https://omarchy.org/discord\033[0m"' ERR
omarchy-snapshot create || [ $? -eq 127 ]
omarchy-update-git
omarchy-update-perform

View File

@@ -1,5 +1,7 @@
#!/bin/bash
set -e
echo -e "\e[32mUpdate Omarchy\e[0m"
git -C $OMARCHY_PATH pull --autostash

View File

@@ -1,5 +1,7 @@
#!/bin/bash
set -e
# Used in package emergencies if a bad package has been pushed and we can't revoke.
# Requires manually installing the good package using sudo pacman -U <url>
ignored_packages=$(omarchy-pkg-ignored)