Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fb226e1

Browse files
committed
feat(install): add deploy_dotfiles and patch_linux_compat functions
1 parent f73bf82 commit fb226e1

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

install-debian.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,3 +92,41 @@ install_zoxide() {
9292
sudo mv "$HOME/.local/bin/zoxide" /usr/local/bin/zoxide
9393
log_ok zoxide
9494
}
95+
96+
# ============================================
97+
# Step 6 — Deploy Dotfiles
98+
# ============================================
99+
deploy_dotfiles() {
100+
should_skip dotfiles && { log_skip dotfiles; return; }
101+
cd "$HOME/.dotfiles"
102+
stow .
103+
log_ok dotfiles
104+
}
105+
106+
# ============================================
107+
# Step 7 — Linux Compat Patches
108+
# ============================================
109+
patch_linux_compat() {
110+
should_skip patch && { log_skip patch; return; }
111+
local fish_cfg="$HOME/.config/fish/config.fish"
112+
local tmux_cfg="$HOME/.config/tmux/tmux.conf"
113+
114+
# Patch 1: make brew sourcing a no-op when brew is absent
115+
if grep -q '/opt/homebrew/bin/brew shellenv | source' "$fish_cfg"; then
116+
sed -i 's@/opt/homebrew/bin/brew shellenv | source@command -q brew; and brew shellenv | source@' "$fish_cfg"
117+
fi
118+
119+
# Patch 2: strip macOS-only PATH entries
120+
sed -i '/lm-studio\/bin/d; /\.opencode\/bin/d; /\.agent-view\/bin/d' "$fish_cfg"
121+
122+
# Patch 3: fix tmux fish path (Homebrew → system)
123+
if grep -q '/opt/homebrew/bin/fish' "$tmux_cfg"; then
124+
sed -i 's@/opt/homebrew/bin/fish@/usr/bin/fish@g' "$tmux_cfg"
125+
fi
126+
127+
echo ""
128+
echo "WARNING: patch_linux_compat modified files inside ~/.dotfiles via stow symlinks."
129+
echo " Do NOT commit these changes — they would break the macOS config."
130+
echo " Run: git -C ~/.dotfiles diff"
131+
log_ok patch
132+
}

0 commit comments

Comments
 (0)