From 7509fa4440d6bd73dba5c00e06c08ccf84a63768 Mon Sep 17 00:00:00 2001 From: Anton Volnuhin Date: Tue, 3 Mar 2026 23:08:36 +0300 Subject: [PATCH] gate env.lat summary steps on ENVLAT env var Only add the 2 bootstrap steps (prerequisites, chezmoi install) to the summary block when running via env.lat. Direct chezmoi apply keeps original step counts and starts from step 1. Co-Authored-By: Claude Opus 4.6 --- run_onchange_after_install_main_deps.sh.tmpl | 40 ++++++++++++-------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/run_onchange_after_install_main_deps.sh.tmpl b/run_onchange_after_install_main_deps.sh.tmpl index 938dd44..3ada118 100644 --- a/run_onchange_after_install_main_deps.sh.tmpl +++ b/run_onchange_after_install_main_deps.sh.tmpl @@ -20,20 +20,24 @@ # Signal env.lat to stop padding and let us handle our own formatting echo "##ENVLAT_END##" -#Config — step counts include 2 env.lat bootstrap steps +#Config {{ if eq .chezmoi.os "darwin" -}} -STEPS=11 +STEPS=9 {{ else if eq .chezmoi.os "freebsd" -}} -STEPS=11 +STEPS=9 {{ else if eq .chezmoi.os "openbsd" -}} -STEPS=10 +STEPS=8 {{ else if eq .chezmoi.osRelease.id "ubuntu" -}} -STEPS=16 -{{ else if eq .chezmoi.osRelease.id "debian" -}} -STEPS=15 -{{ else -}} STEPS=14 +{{ else if eq .chezmoi.osRelease.id "debian" -}} +STEPS=13 +{{ else -}} +STEPS=12 {{ end -}} +# Add env.lat bootstrap steps if running from env.lat +if [ -n "$ENVLAT" ]; then + STEPS=$(($STEPS + 2)) +fi PAD_LEN=4 BASE_PACKAGES="gnupg curl wget git" @@ -98,7 +102,11 @@ cd #Setup USER=$(whoami) -STEP=3 # env.lat already completed steps 1-2 +if [ -n "$ENVLAT" ]; then + STEP=3 # env.lat already completed steps 1-2 +else + STEP=1 +fi if [ "$NON_INTERACTIVE" -eq 1 ]; then # Simple output for non-interactive mode (Vagrant, CI, etc.) @@ -178,12 +186,14 @@ if [ "$NON_INTERACTIVE" -eq 0 ]; then LINES=$(tput lines) print_block # Pre-fill env.lat bootstrap steps as already completed - tput csr 0 $LINES - tput cup $(($LINES - $STEPS - 2 + 1)) 0 - echo -e "==> "$Green"Installing prerequisites"$NC - tput cup $(($LINES - $STEPS - 2 + 2)) 0 - echo -e "==> "$Green"Installing dotfiles via chezmoi"$NC - tput csr 0 $(($LINES - $STEPS - 3)) + if [ -n "$ENVLAT" ]; then + tput csr 0 $LINES + tput cup $(($LINES - $STEPS - 2 + 1)) 0 + echo -e "==> "$Green"Installing prerequisites"$NC + tput cup $(($LINES - $STEPS - 2 + 2)) 0 + echo -e "==> "$Green"Installing dotfiles via chezmoi"$NC + tput csr 0 $(($LINES - $STEPS - 3)) + fi fi new_line "Update caches and upgrade packages"