From b75e70fb9b5a561c5880afe87f3c7ffdb1f2dc01 Mon Sep 17 00:00:00 2001 From: Ryan Hughes Date: Mon, 27 Oct 2025 18:12:35 -0400 Subject: [PATCH] Add an update confirmation Will prevent some users from accidentally clicking the update icon only to terminate and wind up in a broken state. --- bin/omarchy-update | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/bin/omarchy-update b/bin/omarchy-update index 0152af0c..8bfd3c9e 100755 --- a/bin/omarchy-update +++ b/bin/omarchy-update @@ -4,6 +4,21 @@ 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 +gum style --border rounded --border-foreground 6 --padding "1 2" --margin "1 0" \ + "Ready to update Omarchy?" \ + "" \ + "• You cannot stop the update once you start!" \ + "• Make sure you're not on battery power or have sufficient charge" + +if ! gum confirm --default=false \ + --prompt.foreground=6 \ + --selected.foreground=0 --selected.background=2 \ + --unselected.foreground=0 --unselected.background=7 \ + "Continue with update?"; then + echo "Update cancelled" + exit 0 +fi + omarchy-snapshot create || [ $? -eq 127 ] omarchy-update-git omarchy-update-perform