From 5aac726354b7f0d527f49c983357f5d60e4095b1 Mon Sep 17 00:00:00 2001 From: Joey Hafner Date: Wed, 14 Feb 2024 12:35:16 -0800 Subject: [PATCH] Fix handling when no changes to apply --- homelab/wizard/config/configure.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/homelab/wizard/config/configure.sh b/homelab/wizard/config/configure.sh index c62f8ed5..b8b0e77f 100644 --- a/homelab/wizard/config/configure.sh +++ b/homelab/wizard/config/configure.sh @@ -53,15 +53,16 @@ echo "===== Configure system... =====" echo "===== Failed to configure system =====" } -if ! [[ compare | grep -q 'No changes between working and active configurations.' ]] +if compare | grep -q 'No changes between working and active configurations.' then - { # try commit, save + echo "No changes to commit." + exit +else + { # compare, try commit, save, exit compare commit && save && exit } || { # catch, exit discard and print a very basic error message exit discard echo "Failed to commit and save the configuration." } -else - echo "No changes to commit." fi