Fix erroring out when no changes to commit

This commit is contained in:
Joey Hafner 2024-02-14 12:25:48 -08:00
parent 5e10ef0b30
commit 3c6c4d63a6

View File

@ -53,11 +53,15 @@ echo "===== Configure system... ====="
echo "===== Failed to configure system ====="
}
compare
{ # try commit, save
commit && save && exit
} || { # catch, exit discard and print a very basic error message
exit discard
echo "Failed to commit and save the configuration."
}
if ! [[ compare | grep -q 'No changes between working and active configurations.' ]]
then
{ # try commit, save
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