Commit a8f3e46aa62d

Vincent Demeester <vincent@sbr.pm>
2026-02-15 21:32:59
feat(flake-update): include log tail in inbox TODO
Added last 30 lines of the build log as an org src block in the inbox TODO entry on failure for quick diagnosis without needing to access the log file directly.
1 parent 4d27666
Changed files (1)
tools
nix-flake-update
tools/nix-flake-update/nix-flake-update.sh
@@ -62,6 +62,13 @@ add_todo_to_inbox() {
 
   if [ -f "$INBOX_ORG" ]; then
     log "Adding TODO to $INBOX_ORG"
+
+    # Capture last 30 lines of the log file for quick diagnosis
+    local log_tail=""
+    if [ -f "$LOG_FILE" ]; then
+      log_tail=$(tail -30 "$LOG_FILE")
+    fi
+
     cat >> "$INBOX_ORG" <<EOF
 * TODO $title
   SCHEDULED: <$(date '+%Y-%m-%d %a')>
@@ -72,6 +79,10 @@ add_todo_to_inbox() {
 $details
 
 Log file: $LOG_FILE
+
+#+begin_src text
+$log_tail
+#+end_src
 EOF
   else
     log "WARNING: Inbox file not found: $INBOX_ORG"