Add update logger w/ analysis

This commit is contained in:
Ryan Hughes
2026-01-08 16:52:49 -05:00
parent bf779a6bbc
commit 63b0cd64bd
2 changed files with 24 additions and 0 deletions

18
bin/omarchy-update-analyze-logs Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/bash
update_log="/tmp/omarchy-update.log"
# Check for errors
if grep -qi "error" "$update_log"; then
echo -e "\e[31mNon-stopping errors detected during update:\e[0m"
grep -i "error" "$update_log"
echo
fi
# Check for initramfs generation failure
if grep -q "Updating linux initcpios" "$update_log"; then
if ! grep -q "Initcpio image generation successful" "$update_log"; then
echo -e '\e[31mError: Initramfs generation may have failed. Review logs before restart.\e[0m'
echo
fi
fi

View File

@@ -5,6 +5,9 @@ set -e
# Ensure screensaver/sleep doesn't set in during updates # Ensure screensaver/sleep doesn't set in during updates
hyprctl dispatch tagwindow +noidle &> /dev/null || true hyprctl dispatch tagwindow +noidle &> /dev/null || true
# Capture update logs
exec > >(tee "/tmp/omarchy-update.log") 2>&1
# Perform all update steps # Perform all update steps
omarchy-update-time omarchy-update-time
omarchy-update-keyring omarchy-update-keyring
@@ -12,6 +15,9 @@ omarchy-update-available-reset
omarchy-update-system-pkgs omarchy-update-system-pkgs
omarchy-migrate omarchy-migrate
omarchy-hook post-update omarchy-hook post-update
omarchy-update-analyze-logs
omarchy-update-restart omarchy-update-restart
# Re-enable screensaver/sleep after updates # Re-enable screensaver/sleep after updates