-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify.sh
More file actions
executable file
·127 lines (108 loc) · 3.79 KB
/
verify.sh
File metadata and controls
executable file
·127 lines (108 loc) · 3.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
# Verify dotfiles symlinks are in place and working
# Run this to detect drift; run install.sh to fix issues
set -euo pipefail
errors=0
warnings=0
# Check if symlink exists and is valid (doesn't care which dotfiles clone)
check_symlink() {
local target="$1"
local description="$2"
if [ ! -L "$target" ] && [ ! -e "$target" ]; then
echo "MISSING: $description"
echo " $target does not exist"
((errors++)) || true
elif [ -L "$target" ]; then
if [ ! -e "$target" ]; then
echo "BROKEN: $description"
echo " $target is a broken symlink"
((errors++)) || true
fi
# Symlink exists and is valid - good enough
elif [ -e "$target" ]; then
echo "NOT SYMLINK: $description"
echo " $target exists but is not a symlink"
((errors++)) || true
fi
}
# For files that might be managed by home-manager instead
check_symlink_or_hm() {
local target="$1"
local description="$2"
if [ ! -L "$target" ] && [ ! -e "$target" ]; then
echo "MISSING: $description"
echo " $target does not exist"
((errors++)) || true
elif [ -L "$target" ]; then
if [ ! -e "$target" ]; then
echo "BROKEN: $description"
echo " $target is a broken symlink"
((errors++)) || true
fi
# Symlink exists and is valid - could be dotfiles or home-manager
elif [ -e "$target" ]; then
# File exists but is not a symlink - might be home-manager managed (mutable file)
echo "INFO: $description is a regular file (possibly home-manager managed)"
((warnings++)) || true
fi
}
echo "Checking dotfiles symlinks..."
echo ""
# Shell
check_symlink "$HOME/.bashrc" ".bashrc"
check_symlink "$HOME/.bashrc.d" ".bashrc.d"
check_symlink "$HOME/.bash_profile" ".bash_profile"
# Git
check_symlink "$HOME/.gitconfig" ".gitconfig"
check_symlink "$HOME/.gitignore_global" ".gitignore_global"
# Vim
check_symlink "$HOME/.vimrc" ".vimrc"
# Neovim - top level files
check_symlink "$HOME/.config/nvim/init.lua" "nvim/init.lua"
check_symlink "$HOME/.config/nvim/lazy-lock.json" "nvim/lazy-lock.json"
# Neovim - top level directories
check_symlink "$HOME/.config/nvim/autoload" "nvim/autoload"
check_symlink "$HOME/.config/nvim/ftplugin" "nvim/ftplugin"
# Neovim - lua subdirectories
check_symlink "$HOME/.config/nvim/lua/config" "nvim/lua/config"
check_symlink "$HOME/.config/nvim/lua/plugins" "nvim/lua/plugins"
check_symlink "$HOME/.config/nvim/lua/user" "nvim/lua/user"
# Neovim - lua top-level files (ccremote.lua, etc.)
# These might be home-manager managed on some systems
for f in "$HOME/.config/nvim/lua/"*.lua; do
[ -e "$f" ] || continue
fname=$(basename "$f")
check_symlink_or_hm "$f" "nvim/lua/$fname"
done
# Tmux
check_symlink "$HOME/.tmux.conf" ".tmux.conf"
check_symlink "$HOME/.tmux" ".tmux"
# Claude Code (settings.json may be home-manager managed)
check_symlink_or_hm "$HOME/.claude/settings.json" ".claude/settings.json"
check_symlink_or_hm "$HOME/.claude/hooks" ".claude/hooks"
# Claude skills - check expected ones exist (some may be home-manager managed)
expected_skills=(
"configuring-neovim"
"creating-ephemeral-k8s-exec-pods"
"fixing-tmux-socket-issues"
"managing-stacked-prs"
"querying-web-search-agent"
"using-github-api-with-gh"
)
for skill in "${expected_skills[@]}"; do
check_symlink_or_hm "$HOME/.claude/skills/$skill" ".claude/skills/$skill"
done
# Claude commands - check expected ones exist
# (Currently none in dotfiles, all migrated to workstation or private)
echo ""
if [ $errors -eq 0 ] && [ $warnings -eq 0 ]; then
echo "All symlinks OK"
exit 0
elif [ $errors -eq 0 ]; then
echo "All symlinks OK ($warnings info message(s))"
exit 0
else
echo "Found $errors error(s). Run install.sh to fix."
[ $warnings -gt 0 ] && echo "Also: $warnings info message(s) (likely home-manager managed)"
exit 1
fi