-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.sh
More file actions
76 lines (65 loc) · 1.83 KB
/
Copy pathbootstrap.sh
File metadata and controls
76 lines (65 loc) · 1.83 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
#!/bin/bash
DOTFILES_DIR="$(cd "$(dirname "$0")" && pwd)"
# Parse command line arguments
UPDATE_MODE=false
INTERACTIVE=true # Default to interactive mode
while [[ $# -gt 0 ]]; do
case $1 in
--update)
UPDATE_MODE=true
echo "🔄 Update mode enabled"
shift
;;
--all|-a)
INTERACTIVE=false
shift
;;
*)
echo "Unknown option: $1"
echo "Usage: $0 [--update] [--all|-a]"
exit 1
;;
esac
done
echo "🚀 Starting dotfiles setup..."
# Detect operating system - macOS only
if [[ "$OSTYPE" != "darwin"* ]]; then
echo "❌ This script is designed for macOS only."
echo " Detected OSTYPE: $OSTYPE"
exit 1
fi
# Define available setup modules
AVAILABLE_MODULES=("brew" "secrets" "zsh" "karabiner" "cursor" "claude" "zed" "macos")
SELECTED_MODULES=()
if [[ "$INTERACTIVE" == true ]]; then
echo ""
echo "Select modules to install (press enter to toggle, 'a' for all, 'd' for done):"
echo ""
for module in "${AVAILABLE_MODULES[@]}"; do
read -p "Install $module? (y/n): " REPLY
if [[ "$REPLY" == "y" ]]; then
SELECTED_MODULES+=("$module")
fi
done
SETUP_ORDER=("${SELECTED_MODULES[@]}")
else
# Default: install everything
SETUP_ORDER=("${AVAILABLE_MODULES[@]}")
fi
for dir in "${SETUP_ORDER[@]}"; do
setup_script="$DOTFILES_DIR/$dir/setup.sh"
if [ -f "$setup_script" ]; then
"$setup_script" $UPDATE_MODE
fi
done
echo ""
echo "✨ Bootstrap complete!"
echo ""
echo "Next steps:"
echo "1. Edit $DOTFILES_DIR/secrets/.secrets with your actual values"
echo "2. Run 'cd $DOTFILES_DIR && stow zsh git' to create symlinks"
echo "3. Restart your terminal or run 'source ~/.zshrc'"
echo ""
echo "💡 Tips:"
echo " - Run './bootstrap.sh --update' to update all packages and plugins"
echo " - Run './bootstrap.sh --all' to install all modules without prompts"