-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·59 lines (47 loc) · 1.57 KB
/
install.sh
File metadata and controls
executable file
·59 lines (47 loc) · 1.57 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
#!/bin/bash
# Dotfiles Installation Script
# Creates symlinks from home directory to dotfiles repo
set -e
DOTFILES_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
HOME_DIR="$HOME"
echo "Installing dotfiles from $DOTFILES_DIR to $HOME_DIR"
echo ""
# Function to create symlink with backup
create_symlink() {
local source="$1"
local target="$2"
if [ -e "$target" ] && [ ! -L "$target" ]; then
echo " Backing up existing $target to ${target}.backup"
mv "$target" "${target}.backup"
fi
if [ -L "$target" ]; then
rm "$target"
fi
ln -s "$source" "$target"
echo " Linked: $target -> $source"
}
# Create bin directory if it doesn't exist
mkdir -p "$HOME_DIR/bin"
# Symlink dotfiles
echo "Creating symlinks for dotfiles..."
create_symlink "$DOTFILES_DIR/.bashrc" "$HOME_DIR/.bashrc"
create_symlink "$DOTFILES_DIR/.profile" "$HOME_DIR/.profile"
create_symlink "$DOTFILES_DIR/.gitconfig" "$HOME_DIR/.gitconfig"
# Symlink bin scripts
echo ""
echo "Creating symlinks for bin scripts..."
for script in "$DOTFILES_DIR/bin/"*; do
script_name=$(basename "$script")
create_symlink "$script" "$HOME_DIR/bin/$script_name"
done
# Make scripts executable
chmod +x "$DOTFILES_DIR/bin/"*
chmod +x "$DOTFILES_DIR/setup-server.sh"
chmod +x "$DOTFILES_DIR/install.sh"
echo ""
echo "Installation complete!"
echo ""
echo "Notes:"
echo " - Original files were backed up with .backup extension"
echo " - Run 'source ~/.bashrc' to reload your shell configuration"
echo " - Run './setup-server.sh' to install development tools (Docker, PostgreSQL, etc.)"