-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·62 lines (56 loc) · 2.26 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·62 lines (56 loc) · 2.26 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
#!/usr/bin/env zsh
set -euo pipefail
SCRIPT_DIR="${0:A:h}"
BACKUP_DIR="${SCRIPT_DIR:h}/Backup"
BREWFILE="$BACKUP_DIR/Brewfile"
PIPFILE="$BACKUP_DIR/requirements.txt"
CLAUDE_SETTINGS="$BACKUP_DIR/claude-settings.json"
echo "------------------------------------"
echo "- Installing BREW bundle -"
echo "------------------------------------"
# brew bundle natively covers taps, formulas, casks, mas, vscode
# extensions, cargo and npm packages — one manifest for all of them.
if command -v brew >/dev/null 2>&1 && [ -f "$BREWFILE" ]; then
brew bundle install --file="$BREWFILE"
else
echo "skip: brew not installed or $BREWFILE missing"
fi
echo "------------------------------------"
echo "- Installing PIP packages -"
echo "------------------------------------"
if command -v pip3 >/dev/null 2>&1 && [ -f "$PIPFILE" ]; then
pip3 install --user --break-system-packages -r "$PIPFILE"
else
echo "skip: pip3 not installed or $PIPFILE missing"
fi
echo "------------------------------------"
echo "- Installing FISH plugins -"
echo "------------------------------------"
# fisher comes from the Brewfile and reads the stowed
# ~/.config/fish/fish_plugins; `fisher update` installs everything in it.
if command -v fish >/dev/null 2>&1 && [ -f "$HOME/.config/fish/fish_plugins" ]; then
fish -c "fisher update"
else
echo "skip: fish not installed or fish_plugins not stowed"
fi
echo "------------------------------------"
echo "- Installing TPM -"
echo "------------------------------------"
TPM_DIR="$HOME/.config/tmux/plugins/tpm"
if [ ! -d "$TPM_DIR" ]; then
git clone https://github.com/tmux-plugins/tpm "$TPM_DIR"
fi
"$TPM_DIR/bin/install_plugins"
echo "------------------------------------"
echo "- Restoring Claude settings -"
echo "------------------------------------"
# ~/.claude/settings.json is deliberately NOT stowed — Claude Code
# rewrites it in place, which replaces a symlink with a real file.
# Seed it from the backup only when absent; never clobber a live one.
if [ ! -f "$HOME/.claude/settings.json" ] && [ -f "$CLAUDE_SETTINGS" ]; then
mkdir -p "$HOME/.claude"
cp "$CLAUDE_SETTINGS" "$HOME/.claude/settings.json"
echo "seeded ~/.claude/settings.json from Backup/"
else
echo "skip: ~/.claude/settings.json already present"
fi