-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsync.sh
61 lines (52 loc) · 1.8 KB
/
sync.sh
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
#!/bin/bash
source ./console.sh
# 1. Nvim
if [ -d "$HOME/.config/nvim" ]; then
if [ -d "./nvim" ]; then
rm -rf ./nvim/
fi
cp -r "$HOME/.config/nvim/" ./nvim/ || display_error_and_exit "❌ Failed to copy nvim configuration."
echo "✅ Nvim"
else
echo "⚠️ Error: ~/.config/nvim/ directory not found. Nvim sync task is reverted."
fi
# 2. Tmux
if [ -f "$HOME/.tmux.conf" ]; then
if [ -f "./.tmux.conf" ]; then
rm -rf ./.tmux.conf
fi
cp "$HOME/.tmux.conf" "./.tmux.conf" || display_error_and_exit "❌ Failed to copy tmux configuration."
cp "$HOME/.config/tmux/tmux-sessionizer" "./tmux-sessionizer" || display_error_and_exit "❌ Failed to copy tmux sessionizer."
echo "✅ Tmux"
else
echo "⚠️ Error: ~/.tmux.conf not found. Tmux configuration was not synced."
fi
# 3. Alacritty
if [ -d "$HOME/.config/alacritty" ]; then
if [ -f "./alacritty.toml" ]; then
rm -rf ./alacritty.toml
fi
cp "$HOME/.config/alacritty/alacritty.toml" "./alacritty.toml" || display_error_and_exit "❌ Failed to copy alacritty configuration."
echo "✅ Alacritty"
else
echo "⚠️ Error: ~/.config/alacritty not found. Alacritty configuration was not synced."
fi
# 4. Zsh
if [ -d "$HOME/.config/zsh" ]; then
if [ -f "./zsh/.zshrc" ]; then
rm -rf ./zsh/.zshrc
fi
if [ -f "./zsh/.aliases" ]; then
rm -rf ./zsh/.aliases
fi
if [ -f "./.zshenv" ]; then
rm -rf ./.zshenv
fi
cp "$HOME/.config/zsh/.zshrc" "./zsh/.zshrc" || display_error_and_exit "❌ Failed to copy zsh configuration."
cp "$HOME/.config/zsh/.aliases" "./zsh/.aliases" || display_error_and_exit "❌ Failed to copy zsh configuration."
cp "$HOME/.zshenv" "./.zshenv" || display_error_and_exit "❌ Failed to copy zsh configuration."
echo "✅ Zsh"
else
echo "⚠️ Error: ~/.config/zsh not found. Zsh configuration was not synced."
fi
echo "Sync completed!"