diff --git a/bin/omarchy-hook b/bin/omarchy-hook index caa83988..30b7b1f6 100755 --- a/bin/omarchy-hook +++ b/bin/omarchy-hook @@ -1,5 +1,7 @@ #!/bin/bash +set -e + if [[ $# -lt 1 ]]; then echo "Usage: omarchy-hook [name] [args...]" exit 1 diff --git a/bin/omarchy-snapshot b/bin/omarchy-snapshot index 7174081b..ee79512a 100755 --- a/bin/omarchy-snapshot +++ b/bin/omarchy-snapshot @@ -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}') diff --git a/bin/omarchy-update b/bin/omarchy-update index 3ce5e4e6..0152af0c 100755 --- a/bin/omarchy-update +++ b/bin/omarchy-update @@ -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 diff --git a/bin/omarchy-update-git b/bin/omarchy-update-git index 5743e4d1..3eca676f 100755 --- a/bin/omarchy-update-git +++ b/bin/omarchy-update-git @@ -1,5 +1,7 @@ #!/bin/bash +set -e + echo -e "\e[32mUpdate Omarchy\e[0m" git -C $OMARCHY_PATH pull --autostash diff --git a/bin/omarchy-update-system-pkgs b/bin/omarchy-update-system-pkgs index 28baffda..b1928696 100755 --- a/bin/omarchy-update-system-pkgs +++ b/bin/omarchy-update-system-pkgs @@ -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 ignored_packages=$(omarchy-pkg-ignored)