-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
30 lines (24 loc) · 742 Bytes
/
install.sh
File metadata and controls
30 lines (24 loc) · 742 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
#!/usr/bin/env bash
# Create .config directory if it doesn't exist
mkdir -p "$HOME/.config"
# Create symlinks for all directories in .config
for dir in "$PWD"/.config/*; do
# If directory exists, move it to a backup
if [[ -d "$HOME/.config/$(basename $dir)" ]]; then
mv "$HOME/$dir" "$HOME/${dir}_bkp"
fi
# Create symlink
ln -s "$dir" "$HOME/.config/$(basename $dir)"
done
for file in .*; do
# Skip files
if [[ "$file" == ".config" || "$file" == ".git" || "$file" == ".gitignore" ]]; then
continue
fi
# If file exists, move it to a backup
if [[ -a "$HOME/$file" ]]; then
mv "$HOME/$file" "$HOME/${file}_bkp"
fi
# Create symlink
ln -s "$PWD/$file" "$HOME"
done