Repository navigation
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·51 lines (40 loc) · 1.69 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·51 lines (40 loc) · 1.69 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
#!/usr/bin/env bash
set -e
DOTFILES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TARGET_DIR="${HOME}"
PACKAGES=("antigravity" "vim" "tmux" "nvim" "vscode")
echo "==> Setting up dotfiles from: ${DOTFILES_DIR}"
echo "==> Target directory: ${TARGET_DIR}"
if command -v stow >/dev/null 2>&1; then
echo "==> GNU Stow detected. Linking packages with stow..."
for pkg in "${PACKAGES[@]}"; do
if [ -d "${DOTFILES_DIR}/${pkg}" ]; then
echo " -> Stowing ${pkg}"
stow -v -R -t "${TARGET_DIR}" -d "${DOTFILES_DIR}" "${pkg}"
fi
done
echo "==> All packages stowed successfully!"
else
echo "==> GNU Stow not found. Falling back to direct symlinks..."
# Ensure parent directories exist
mkdir -p "${TARGET_DIR}/.config"
mkdir -p "${TARGET_DIR}/.config/Code/User"
mkdir -p "${TARGET_DIR}/.gemini/config"
# Vim & Tmux
ln -sfn "${DOTFILES_DIR}/vim/.vimrc" "${TARGET_DIR}/.vimrc"
echo " -> Linked .vimrc"
ln -sfn "${DOTFILES_DIR}/tmux/.tmux.conf" "${TARGET_DIR}/.tmux.conf"
echo " -> Linked .tmux.conf"
# Neovim
ln -sfn "${DOTFILES_DIR}/nvim/.config/nvim" "${TARGET_DIR}/.config/nvim"
echo " -> Linked .config/nvim"
# VS Code
if [ -f "${DOTFILES_DIR}/vscode/.config/Code/User/settings.json" ]; then
ln -sfn "${DOTFILES_DIR}/vscode/.config/Code/User/settings.json" "${TARGET_DIR}/.config/Code/User/settings.json"
echo " -> Linked VS Code settings.json"
fi
# Antigravity Skills
ln -sfn "${DOTFILES_DIR}/antigravity/.gemini/config/skills" "${TARGET_DIR}/.gemini/config/skills"
echo " -> Linked Antigravity skills"
echo "==> All symlinks created successfully!"
fi