-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·24 lines (23 loc) · 791 Bytes
/
setup.sh
File metadata and controls
executable file
·24 lines (23 loc) · 791 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
#!/bin/bash
# List of folder names to copy
folders=("foot" "waybar" "wofi" "sway" "tofi")
config=$HOME/.config
# Loop through each folder in the list
for folder in "${folders[@]}"; do
# Check if folder already exists in B
if [ -d "$config/$folder" ]; then
# Check if the homonymous folder contains ".andredot" file
if [ -f "$config/$folder/.andredot" ]; then
echo "andredot found, adding .bak termination"
fi
if [ -d "$config/${folder}.bak" ]; then
echo "Found a $config/${folder}.bak, proceeding would destroy the backup. Exiting"
exit 1
fi
# Add .bak termination to the homonymous folder
mv "$config/$folder" "$config/$folder.bak"
fi
echo "$config/$folder not found, not backing up anything"
# Copy the folder from A to B
cp -R "$PWD/$folder" "$config/"
done