-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync.sh
More file actions
executable file
·47 lines (36 loc) · 1.38 KB
/
sync.sh
File metadata and controls
executable file
·47 lines (36 loc) · 1.38 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
#!/bin/bash
# Dotfiles sync script - backs up configs to this repo
set -e
DOTFILES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "Syncing dotfiles to $DOTFILES_DIR..."
# Create directories
mkdir -p "$DOTFILES_DIR"/{zsh,git,vscode,homebrew,.claude}
# Zsh configs
echo "→ Copying zsh configs..."
cp ~/.zshrc "$DOTFILES_DIR/zsh/.zshrc"
# Git config
echo "→ Copying git config (excluding maintenance section)..."
awk '/^\[maintenance\]/ {skip=1; next} /^\[/ {skip=0} !skip' ~/.gitconfig > "$DOTFILES_DIR/git/.gitconfig"
# VSCode configs
echo "→ Copying VSCode configs..."
cp ~/Library/Application\ Support/Code/User/settings.json "$DOTFILES_DIR/vscode/settings.json"
cp ~/Library/Application\ Support/Code/User/keybindings.json "$DOTFILES_DIR/vscode/keybindings.json"
# Homebrew
echo "→ Generating Brewfile..."
cd "$DOTFILES_DIR/homebrew"
brew bundle dump --force
brew leaves > leaves.txt
cd "$DOTFILES_DIR"
# Claude configs
echo "→ Copying Claude configs..."
cp ~/.claude/CLAUDE.md "$DOTFILES_DIR/.claude/"
cp ~/.claude/settings.json "$DOTFILES_DIR/.claude/"
cp -r ~/.claude/commands "$DOTFILES_DIR/.claude/"
cp -r ~/.claude/agents "$DOTFILES_DIR/.claude/"
mkdir -p "$DOTFILES_DIR/.claude/skills"
for skill in ~/.claude/skills/*/; do
name=$(basename "$skill")
[[ "$name" == peon-* ]] && continue
cp -r "$skill" "$DOTFILES_DIR/.claude/skills/"
done
echo "✓ Sync complete!"