-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-configs.sh
More file actions
104 lines (88 loc) · 2.64 KB
/
setup-configs.sh
File metadata and controls
104 lines (88 loc) · 2.64 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
# DevDocker dotfiles configuration script
set -e
echo "================================"
echo "🚀 DevDocker - Dotfiles Setup"
echo "================================"
echo ""
# Ask user for dotfiles repository URL
echo "📦 Please provide your dotfiles repository URL:"
echo " Example: https://github.com/username/dotfiles.git"
echo ""
read -p "Repository URL: " DOTFILES_REPO
# Validate input
if [ -z "$DOTFILES_REPO" ]; then
echo "❌ Error: URL cannot be empty!"
exit 1
fi
echo ""
echo "✅ Repository set: $DOTFILES_REPO"
echo ""
# Temporary directory for cloning
TEMP_DIR="/tmp/dotfiles-temp"
echo "📥 Cloning configurations..."
rm -rf $TEMP_DIR
# Clone repository with error handling
if ! git clone $DOTFILES_REPO $TEMP_DIR 2>&1; then
echo ""
echo "❌ Failed to clone repository!"
echo " Check if the URL is correct and you have access."
exit 1
fi
echo "✅ Repository cloned successfully!"
echo ""
# Configure Neovim
if [ -d "$TEMP_DIR/nvim" ]; then
echo "⚙️ Configuring Neovim..."
rm -rf ~/.config/nvim
mkdir -p ~/.config
cp -r $TEMP_DIR/nvim ~/.config/
echo "✅ Neovim configured!"
elif [ -d "$TEMP_DIR/lvim" ]; then
echo "⚙️ Configuring Neovim (LunarVim)..."
rm -rf ~/.config/nvim
mkdir -p ~/.config
cp -r $TEMP_DIR/lvim ~/.config/nvim
echo "✅ Neovim configured!"
else
echo "⚠️ 'nvim' or 'lvim' folder not found in repository"
fi
# Configure Tmux
if [ -f "$TEMP_DIR/.tmux.conf" ]; then
echo "⚙️ Configuring Tmux..."
cp $TEMP_DIR/.tmux.conf ~/
echo "✅ Tmux configured!"
else
echo "⚠️ '.tmux.conf' file not found in repository"
fi
# Configure Bash
if [ -f "$TEMP_DIR/.bashrc" ]; then
echo "⚙️ Configuring Bash..."
cp $TEMP_DIR/.bashrc ~/
echo "✅ Bash configured!"
elif [ -f "$TEMP_DIR/.bashr" ]; then
echo "⚙️ Configuring Bash..."
cp $TEMP_DIR/.bashr ~/.bashrc
echo "✅ Bash configured!"
else
echo "⚠️ '.bashrc' file not found in repository"
fi
# Tmux Plugin Manager
if [ -d "$TEMP_DIR/.tmux" ]; then
echo "⚙️ Copying Tmux plugins..."
cp -r $TEMP_DIR/.tmux ~/
elif [ ! -d ~/.tmux/plugins/tpm ]; then
echo "📦 Installing Tmux Plugin Manager..."
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
fi
# Cleanup
rm -rf $TEMP_DIR
echo ""
echo "✨ Setup complete!"
echo ""
echo "📋 Next steps:"
echo " 1. Authenticate Copilot CLI: Run 'copilot' then use '/login' command"
echo " 2. Install Neovim plugins: nvim +PackerSync (or equivalent)"
echo " 3. Install Tmux plugins: tmux then press <prefix> + I"
echo " 4. Reload bash: source ~/.bashrc"
echo ""