-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
Β·37 lines (27 loc) Β· 870 Bytes
/
Copy pathinstall.sh
File metadata and controls
executable file
Β·37 lines (27 loc) Β· 870 Bytes
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
#!/bin/bash
DOTFILES_DIR="$HOME/workspace/github-project/dotfiles"
CONFIG_DIR="$HOME/.config"
BACKUP_DIR="$HOME/dotfiles_backup"
echo "π Setting up dotfiles..."
mkdir -p "$BACKUP_DIR"
for file in "$DOTFILES_DIR/home/".*; do
filename=$(basename "$file")
target="$HOME/$filename"
if [ -f "$target" ] || [ -d "$target" ]; then
echo "π Backing up $filename to $BACKUP_DIR"
mv "$target" "$BACKUP_DIR/"
fi
echo "π Creating symlink: $filename"
ln -s "$file" "$target"
done
for folder in "$DOTFILES_DIR/config/"*; do
foldername=$(basename "$folder")
target="$CONFIG_DIR/$foldername"
if [ -d "$target" ] || [ -L "$target" ]; then
echo "π Backing up $foldername to $BACKUP_DIR"
mv "$target" "$BACKUP_DIR/"
fi
echo "π Creating symlink: $foldername"
ln -s "$folder" "$target"
done
echo "β
Dotfiles setup complete!"