Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion public/checksum.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
6de66efba021ebcf462e7672577d9f6876f13db55691f04e7009ff7e78d658b8 public/sh/install_zpmod.sh
eff43da44827d4774eed21d31d841df04b9cd8fe089c1b59d38bef3608920754 public/sh/install.sh
2308d14ff74b9bb5928c4d0abfb9ae0d4268cd253fb871cd3d23d4bbbede6b10 public/sh/install.sh
08cc893ceb982fc99d17db1966c6c30790cc571e16e4f5392352d995f5252952 public/sh/sync-init.sh
c979e39748d1d86ace17a61ff2b1bf6e1224a43291c25bf7fad985d1e9e11af1 public/zsh/init.zsh
9 changes: 7 additions & 2 deletions public/sh/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -318,25 +318,30 @@ ANNEX_PROFILE() {
printf '%s\n' "▓▒░ .zshrc already loads z-shell/z-a-meta-plugins - annex block not added again"
return 0
fi
# The burst file holds only the recipe; zicompinit belongs to .zshrc and
# must not run in the non-interactive burst shell (compinit aborts there).
file="${WORKDIR}/temp-zsh-config"
if [ "${AOPT}" = annex ]; then
command cat <<-EOF >"${file}"
zi light-mode for \\
z-shell/z-a-meta-plugins \\
@annexes # <- https://wiki.zshell.dev/ecosystem/category/-annexes
EOF
printf '%s\n' "▓▒░ Installing annexes"
command cat "${file}" >>"${THE_ZDOTDIR}/.zshrc"
command cat <<-EOF >>"${THE_ZDOTDIR}/.zshrc"
# examples here -> https://wiki.zshell.dev/community/gallery/collection
zicompinit # <- https://wiki.zshell.dev/docs/guides/commands
EOF
printf '%s\n' "▓▒░ Installing annexes"
else
command cat <<-EOF >"${file}"
zi light-mode for \\
z-shell/z-a-meta-plugins \\
@annexes @zunit
EOF
printf '%s\n' "▓▒░ Installing annexes + zunit"
command cat "${file}" >>"${THE_ZDOTDIR}/.zshrc"
fi
command cat "${file}" >>"${THE_ZDOTDIR}/.zshrc"
ANNEX_BURST "${file}"
}

Expand Down
12 changes: 12 additions & 0 deletions tests/installers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,13 @@ for arg; do
esac
[ "${arg}" != "-c" ] || break
done
# Whatever the burst sources must not run compinit: it aborts without a tty.
for arg; do
if [ -f "${arg}" ] && grep -q '^zicompinit' "${arg}" 2>/dev/null; then
printf '%s\n' "zsh test double: burst sources zicompinit from ${arg}" >&2
exit 67
fi
done
[ -z "${ZI_SRC_TEST_ZSH_LOG:-}" ] || printf '%s\n' "zsh $*" >>"${ZI_SRC_TEST_ZSH_LOG}"
EOF

Expand Down Expand Up @@ -787,6 +794,11 @@ test_annex_rerun_is_idempotent() {
contains "${zsh_log}" 'zsh -f -c '
contains "${zsh_log}" "${data}/zi/bin/zi.zsh"
contains "${zsh_log}" 'temp-zsh-config'
# The annex-specific zicompinit reaches .zshrc (directly after the gallery
# comment), not only the one the default block writes.
if ! grep -A1 -F '# examples here -> https://wiki.zshell.dev/community/gallery/collection' "${home}/.zshrc" | grep -q '^zicompinit'; then
fail "annex profile did not write zicompinit after its gallery comment"
fi
pass "annex profile is idempotent across reruns and never starts an interactive shell"
}

Expand Down
Loading