-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlink.sh
More file actions
executable file
·50 lines (41 loc) · 1.54 KB
/
link.sh
File metadata and controls
executable file
·50 lines (41 loc) · 1.54 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
#!/bin/bash
# Convention: every repo file linked into $HOME is referenced as
# "$PWD/<path>" on the source side of an `ln` call. .github/workflows/ci.yml
# greps for that exact `$PWD/...` pattern to verify each source exists in
# the repo, so don't rewrite these as bare paths or relative refs.
# Set up symlinks
if command -v code >/dev/null 2>&1; then
CodeSettings=$PWD/settings.json
CodeSnippets=$PWD/.vscode/snippets
ln -sf "$CodeSettings" "$HOME/Library/Application Support/Code/User/settings.json"
ln -sfn "$CodeSnippets" "$HOME/Library/Application Support/Code/User/snippets"
echo Created VScode settings link
else
echo "VScode is not installed so we won't link settings"
fi
BashSettings=$PWD/.bashrc
ln -sf "$BashSettings" ~
echo Created Bash settings link
ProfileSettings=$PWD/.bash_profile
ln -sf "$ProfileSettings" ~
echo Created Bash_Profile settings link
GitSettings=$PWD/.gitconfig
ln -sf "$GitSettings" ~
echo Created Git settings link
EmacsSettings=$PWD/.emacs
ln -sf "$EmacsSettings" ~
echo Created Emacs settings link
ConfigSettings=$PWD/.config
# -n is critical: without it, ln follows an existing ~/.config symlink and
# creates ~/.config/.config (nesting). With -fn, the existing symlink is
# unlinked and replaced.
ln -sfn "$ConfigSettings" ~/.config
echo Created general config directory link
ClaudeSettings=$PWD/claude_settings.json
mkdir -p ~/.claude
ln -sf "$ClaudeSettings" ~/.claude/settings.json
echo Created Claude Code settings link
SshRc=$PWD/ssh_rc
mkdir -p ~/.ssh
ln -sf "$SshRc" ~/.ssh/rc
echo Created ssh rc link