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 <noreply@anthropic.com>
This commit is contained in:
parent
4f49ec9f80
commit
7509fa4440
@ -20,20 +20,24 @@
|
|||||||
# Signal env.lat to stop padding and let us handle our own formatting
|
# Signal env.lat to stop padding and let us handle our own formatting
|
||||||
echo "##ENVLAT_END##"
|
echo "##ENVLAT_END##"
|
||||||
|
|
||||||
#Config — step counts include 2 env.lat bootstrap steps
|
#Config
|
||||||
{{ if eq .chezmoi.os "darwin" -}}
|
{{ if eq .chezmoi.os "darwin" -}}
|
||||||
STEPS=11
|
STEPS=9
|
||||||
{{ else if eq .chezmoi.os "freebsd" -}}
|
{{ else if eq .chezmoi.os "freebsd" -}}
|
||||||
STEPS=11
|
STEPS=9
|
||||||
{{ else if eq .chezmoi.os "openbsd" -}}
|
{{ else if eq .chezmoi.os "openbsd" -}}
|
||||||
STEPS=10
|
STEPS=8
|
||||||
{{ else if eq .chezmoi.osRelease.id "ubuntu" -}}
|
{{ else if eq .chezmoi.osRelease.id "ubuntu" -}}
|
||||||
STEPS=16
|
|
||||||
{{ else if eq .chezmoi.osRelease.id "debian" -}}
|
|
||||||
STEPS=15
|
|
||||||
{{ else -}}
|
|
||||||
STEPS=14
|
STEPS=14
|
||||||
|
{{ else if eq .chezmoi.osRelease.id "debian" -}}
|
||||||
|
STEPS=13
|
||||||
|
{{ else -}}
|
||||||
|
STEPS=12
|
||||||
{{ end -}}
|
{{ end -}}
|
||||||
|
# Add env.lat bootstrap steps if running from env.lat
|
||||||
|
if [ -n "$ENVLAT" ]; then
|
||||||
|
STEPS=$(($STEPS + 2))
|
||||||
|
fi
|
||||||
PAD_LEN=4
|
PAD_LEN=4
|
||||||
|
|
||||||
BASE_PACKAGES="gnupg curl wget git"
|
BASE_PACKAGES="gnupg curl wget git"
|
||||||
@ -98,7 +102,11 @@ cd
|
|||||||
|
|
||||||
#Setup
|
#Setup
|
||||||
USER=$(whoami)
|
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
|
if [ "$NON_INTERACTIVE" -eq 1 ]; then
|
||||||
# Simple output for non-interactive mode (Vagrant, CI, etc.)
|
# Simple output for non-interactive mode (Vagrant, CI, etc.)
|
||||||
@ -178,12 +186,14 @@ if [ "$NON_INTERACTIVE" -eq 0 ]; then
|
|||||||
LINES=$(tput lines)
|
LINES=$(tput lines)
|
||||||
print_block
|
print_block
|
||||||
# Pre-fill env.lat bootstrap steps as already completed
|
# Pre-fill env.lat bootstrap steps as already completed
|
||||||
|
if [ -n "$ENVLAT" ]; then
|
||||||
tput csr 0 $LINES
|
tput csr 0 $LINES
|
||||||
tput cup $(($LINES - $STEPS - 2 + 1)) 0
|
tput cup $(($LINES - $STEPS - 2 + 1)) 0
|
||||||
echo -e "==> "$Green"Installing prerequisites"$NC
|
echo -e "==> "$Green"Installing prerequisites"$NC
|
||||||
tput cup $(($LINES - $STEPS - 2 + 2)) 0
|
tput cup $(($LINES - $STEPS - 2 + 2)) 0
|
||||||
echo -e "==> "$Green"Installing dotfiles via chezmoi"$NC
|
echo -e "==> "$Green"Installing dotfiles via chezmoi"$NC
|
||||||
tput csr 0 $(($LINES - $STEPS - 3))
|
tput csr 0 $(($LINES - $STEPS - 3))
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
new_line "Update caches and upgrade packages"
|
new_line "Update caches and upgrade packages"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user