From dd3b64ef7f7e3d851ef1f46dcb06687b454135df Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 31 Oct 2025 14:33:53 +0100 Subject: [PATCH] Extract the confirmation into its own file --- bin/omarchy-update | 12 +----------- bin/omarchy-update-confirm | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 11 deletions(-) create mode 100755 bin/omarchy-update-confirm diff --git a/bin/omarchy-update b/bin/omarchy-update index deb08e7e..a3a7ac47 100755 --- a/bin/omarchy-update +++ b/bin/omarchy-update @@ -4,17 +4,7 @@ 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 normal --border-foreground 6 --padding "1 2" \ - "Ready to update Omarchy?" \ - "" \ - "• You cannot stop the update once you start!" \ - "• Make sure you're connected to power or have a full battery" - -if ! gum confirm --default=false "Continue with update?"; then - echo "Update cancelled" - exit 0 -fi - +omarchy-update-confirm omarchy-snapshot create || [ $? -eq 127 ] omarchy-update-git omarchy-update-perform diff --git a/bin/omarchy-update-confirm b/bin/omarchy-update-confirm new file mode 100755 index 00000000..d4ff436d --- /dev/null +++ b/bin/omarchy-update-confirm @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +gum style --border normal --border-foreground 6 --padding "1 2" \ + "Ready to update Omarchy?" \ + "" \ + "• You cannot stop the update once you start!" \ + "• Make sure you're connected to power or have a full battery" + +if ! gum confirm --default=false "Continue with update?"; then + echo "Update cancelled" + exit 0 +fi