forked from thoughtbot/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathrun_once_install.sh
More file actions
executable file
·72 lines (56 loc) · 1.49 KB
/
Copy pathrun_once_install.sh
File metadata and controls
executable file
·72 lines (56 loc) · 1.49 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
#!/bin/sh
set -e
# == Pre-install dependency checks ==
echo "==> Checking system dependencies..."
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
missing=0
check_cmd() {
if command -v "$1" >/dev/null 2>&1; then
printf " ${GREEN}✓${NC} %s\n" "$1"
else
printf " ${RED}✗${NC} %s ${YELLOW}(missing)${NC}\n" "$1"
missing=1
fi
}
echo "Required tools:"
check_cmd zsh
check_cmd git
check_cmd nvim
check_cmd tmux
echo ""
echo "Optional tools:"
check_cmd age
echo ""
echo "Secret management:"
if [ -f "$HOME/.config/chezmoi/key.txt" ]; then
printf " ${GREEN}✓${NC} chezmoi age key found\n"
else
printf " ${YELLOW}!${NC} chezmoi age key not found\n"
printf " Run: age-keygen -o ~/.config/chezmoi/key.txt\n"
printf " Then add your public key to chezmoi.toml recipients\n"
fi
echo ""
echo "OS: $(uname -s)"
echo "Arch: $(uname -m)"
if [ "$missing" -eq 1 ]; then
echo ""
printf "${YELLOW}Some dependencies are missing. Please install them before running 'chezmoi apply'.${NC}\n"
else
printf "${GREEN}All required dependencies found.${NC}\n"
fi
# == Post-install tasks ==
echo ""
echo "==> Running post-install tasks..."
touch "$HOME/.psqlrc.local"
if grep -qw path_helper /etc/zshenv 2>/dev/null; then
cat <<MSG
Warning: /etc/zshenv configuration file on your system may cause unexpected
PATH changes on subsequent invocations of the zsh shell. The solution is to
rename the file to zprofile:
sudo mv /etc/{zshenv,zprofile}
MSG
fi
echo "Done."