Fix fisher conflicts and stale end-4 paths found by the smoke test

First real run of tests/smoke.sh surfaced three issues:

- fish.sh: repo configs/ ships fisher.fish and nvm.fish functions, so the
  new (previously always-broken) 'fisher install' hit fisher's own
  conflict check and aborted. Now: check 'type -q fisher' / 'type -q nvm'
  inside fish and only bootstrap what is actually missing.
- fish.sh: end-4 renamed hypr/hyprland/colors.conf to colors.lua and
  moved hyprlock colors under hypr/hyprlock/ - the stale paths made the
  old script abort on cp. Updated paths, warn-and-skip stays as the
  safety net if upstream moves again.
- LazyVim.sh: same fisher conflict class in its fish branch - guard the
  nvm.fish install with a 'type -q nvm' check.
- tests/smoke.sh: the zsh backup assertion was wrong (fresh container has
  no .zshrc for run 1 to back up). Pre-seed a marker config instead and
  assert both rotation (2 backups) and that neither run destroys the
  original content.

Verified: tests/smoke.sh fish.sh zsh.sh -> PASS/PASS, bat.sh -> PASS;
pre-push hook green on all 9 scripts.
This commit is contained in:
alvinlollo
2026-10-08 14:26:56 +11:00
parent f8bb57f666
commit 8320546ad4
3 changed files with 42 additions and 14 deletions
+11 -3
View File
@@ -95,13 +95,21 @@ for script in "${SCRIPTS[@]}"; do
;;
zsh.sh)
run_test "$script" '
# pre-seed a config so BOTH runs have something to back up
printf "# preexisting zshrc marker\n" > /root/.zshrc
bash zsh.sh --skip-watermark
[ -f /root/.zshrc ] || { echo ".zshrc missing"; exit 1; }
[ -d /root/.oh-my-zsh/custom/plugins/zsh-autosuggestions ] || { echo "plugins missing"; exit 1; }
# second run must rotate the backup, not overwrite it
n=$(find /root -maxdepth 1 -name ".zshrc.bak-*" | wc -l)
[ "$n" -eq 1 ] || { echo "expected 1 backup after first run, got $n"; exit 1; }
grep -q "preexisting zshrc marker" /root/.zshrc.bak-* \
|| { echo "first backup does not hold the original config"; exit 1; }
# second run must rotate (new timestamped backup), not overwrite
bash zsh.sh --skip-watermark
[ "$(find /root -maxdepth 1 -name ".zshrc.bak-*" | wc -l)" -ge 2 ] \
|| { echo "backup rotation failed"; exit 1; }
n=$(find /root -maxdepth 1 -name ".zshrc.bak-*" | wc -l)
[ "$n" -eq 2 ] || { echo "expected 2 backups after second run (rotation), got $n"; exit 1; }
grep -q "preexisting zshrc marker" /root/.zshrc.bak-* \
|| { echo "second run destroyed an earlier backup"; exit 1; }
'
;;
fish.sh)