feat(kitty): добавлен stow-пакет с конфигом и темой kitty
- Зачем:
- конфиг kitty не был под контролем версий, а свёрнутый stow-каталог
приводил бы к попаданию рантайм-файлов kitty в репозиторий.
- Что:
- добавлен пакет kitty с минимальным kitty.conf и current-theme.conf
вместо 112 КБ sample-конфига от старой версии.
- в install.sh kitty добавлен в PACKAGES, а ~/.config/kitty создаётся
заранее настоящим каталогом, чтобы stow линковал по файлам.
- тест folding переведён с невыпиленного zed на kitty, устаревшая
проверка ~/.config/zed в тесте миграции заменена на assert_not_exists.
- Проверка:
- bash tests/test_install.sh
This commit is contained in:
1 parent
962012204a
commit
91592c5893
5 files changed
+96
-10
No files matched your search
+20
-9
@@ -37,7 +37,7 @@ setup_fixture() {
|
||||
# zed/.config/opencode и т.п.) весят гигабайты, переполняют /tmp и ломают
|
||||
# stow конфликтами, поэтому в тестовое дерево не попадает.
|
||||
git -C "$REPO_ROOT" ls-files -z --cached -- \
|
||||
install.sh bash tmux vim zed vscode agents opencode codex gemini \
|
||||
install.sh bash tmux vim zed kitty vscode agents opencode codex gemini \
|
||||
claude proxy-client scripts \
|
||||
| tar -C "$REPO_ROOT" --null -T - -cf - \
|
||||
| tar -xf - -C "$repo_root"
|
||||
@@ -114,24 +114,33 @@ test_fresh_install_uses_home_target() {
|
||||
assert_not_exists "$fixture/.bash_custom"
|
||||
}
|
||||
|
||||
test_fresh_install_does_not_fold_config_into_zed() {
|
||||
test_fresh_install_does_not_fold_config_into_kitty() {
|
||||
local fixture repo_root home_dir target expected
|
||||
fixture="$(setup_fixture)"
|
||||
repo_root="$fixture/repo"
|
||||
home_dir="$fixture/home"
|
||||
mkdir -p "$home_dir"
|
||||
|
||||
# Неполный клон: zed остаётся единственным stow-пакетом с каталогом .config.
|
||||
# Неполный клон: kitty остаётся единственным stow-пакетом с каталогом .config.
|
||||
mv "$repo_root/proxy-client" "$fixture/proxy-client-disabled"
|
||||
|
||||
run_install "$repo_root" "$home_dir" env WSL_DISTRO_NAME= INSTALL_INTERACTIVE_MODE=never >"$fixture/install.out"
|
||||
|
||||
[ -d "$home_dir/.config" ] || fail "Expected ~/.config directory"
|
||||
[ ! -L "$home_dir/.config" ] || fail "Expected ~/.config to stay a real directory"
|
||||
[ -L "$home_dir/.config/zed" ] || fail "Expected ~/.config/zed symlink"
|
||||
target="$(readlink -f "$home_dir/.config/zed")"
|
||||
expected="$(readlink -f "$repo_root/zed/.config/zed")"
|
||||
[ "$target" = "$expected" ] || fail "~/.config/zed points to $target, expected $expected"
|
||||
# Каталог остаётся настоящим, симлинки ставятся по файлам: kitty пишет в
|
||||
# ~/.config/kitty свои файлы, и они не должны попадать в репозиторий.
|
||||
[ -d "$home_dir/.config/kitty" ] || fail "Expected ~/.config/kitty directory"
|
||||
[ ! -L "$home_dir/.config/kitty" ] || fail "Expected ~/.config/kitty to stay a real directory"
|
||||
[ -L "$home_dir/.config/kitty/kitty.conf" ] || fail "Expected ~/.config/kitty/kitty.conf symlink"
|
||||
[ -L "$home_dir/.config/kitty/current-theme.conf" ] || fail "Expected ~/.config/kitty/current-theme.conf symlink"
|
||||
target="$(readlink -f "$home_dir/.config/kitty/kitty.conf")"
|
||||
expected="$(readlink -f "$repo_root/kitty/.config/kitty/kitty.conf")"
|
||||
[ "$target" = "$expected" ] || fail "~/.config/kitty/kitty.conf points to $target, expected $expected"
|
||||
|
||||
# Файл, созданный kitty рядом с управляемыми, остаётся вне репозитория.
|
||||
printf '%s\n' '# backup' > "$home_dir/.config/kitty/kitty.conf.bak"
|
||||
assert_not_exists "$repo_root/kitty/.config/kitty/kitty.conf.bak"
|
||||
}
|
||||
|
||||
test_migrates_legacy_zed_config_symlink() {
|
||||
@@ -155,7 +164,9 @@ test_migrates_legacy_zed_config_symlink() {
|
||||
|
||||
[ -d "$home_dir/.config" ] || fail "Expected migrated ~/.config directory"
|
||||
[ ! -L "$home_dir/.config" ] || fail "Expected migrated ~/.config to stop being a symlink"
|
||||
[ -L "$home_dir/.config/zed" ] || fail "Expected managed ~/.config/zed symlink"
|
||||
# zed больше не stow-пакет (см. PACKAGES), поэтому после миграции каталог
|
||||
# zed остаётся в репозитории и в ~/.config не появляется.
|
||||
assert_not_exists "$home_dir/.config/zed"
|
||||
[ -d "$home_dir/.config/btop" ] || fail "Expected btop config to be migrated"
|
||||
[ ! -L "$home_dir/.config/btop" ] || fail "Expected btop config outside the repository"
|
||||
[ -f "$home_dir/.config/proxy-client/default.url" ] || fail "Expected profile to be migrated"
|
||||
@@ -527,7 +538,7 @@ main() {
|
||||
command -v stow >/dev/null 2>&1 || fail "stow is required for tests"
|
||||
|
||||
test_fresh_install_uses_home_target
|
||||
test_fresh_install_does_not_fold_config_into_zed
|
||||
test_fresh_install_does_not_fold_config_into_kitty
|
||||
test_migrates_legacy_zed_config_symlink
|
||||
test_stops_legacy_migration_when_listing_fails
|
||||
test_does_not_migrate_unrelated_config_symlink
|
||||
|
||||
Reference in new issue
Block a user