From c7080c15b27bf58dbf36c51e272369d1d0bf7c9c Mon Sep 17 00:00:00 2001 From: JaKooLit Date: Tue, 17 Sep 2024 09:46:56 +0900 Subject: copy patch --- config/hypr/v2.3.6 | 5 +++++ config/hypr/v2.3.6-D | 5 ----- copy.sh | 39 ++++++++++++++++++++++++++------------- 3 files changed, 31 insertions(+), 18 deletions(-) create mode 100644 config/hypr/v2.3.6 delete mode 100644 config/hypr/v2.3.6-D diff --git a/config/hypr/v2.3.6 b/config/hypr/v2.3.6 new file mode 100644 index 00000000..31b3414d --- /dev/null +++ b/config/hypr/v2.3.6 @@ -0,0 +1,5 @@ +### https://github.com/JaKooLit ### +## https://github.com/JaKooLit/Hyprland-Dots +## This is to have a reference of which version would be + +## note that this will always be higher than the released versions \ No newline at end of file diff --git a/config/hypr/v2.3.6-D b/config/hypr/v2.3.6-D deleted file mode 100644 index 31b3414d..00000000 --- a/config/hypr/v2.3.6-D +++ /dev/null @@ -1,5 +0,0 @@ -### https://github.com/JaKooLit ### -## https://github.com/JaKooLit/Hyprland-Dots -## This is to have a reference of which version would be - -## note that this will always be higher than the released versions \ No newline at end of file diff --git a/copy.sh b/copy.sh index 64d8f7e6..45b614f9 100755 --- a/copy.sh +++ b/copy.sh @@ -333,7 +333,7 @@ printf "\n" # Copy Config Files # set -e # Exit immediately if a command exits with a non-zero status. -printf "${NOTE} - copying dotfiles\n" +printf "${NOTE} - Copying dotfiles first part\n" # Function to create a unique backup directory name with month, day, hours, and minutes get_backup_dirname() { @@ -342,9 +342,17 @@ get_backup_dirname() { echo "back-up_${timestamp}" } -for DIR in btop cava hypr Kvantum qt5ct qt6ct swappy wallust wlogout; do +# Check if the config directory exists +if [ ! -d "config" ]; then + echo "${ERROR} - The 'config' directory does not exist." + exit 1 +fi + +for DIR in btop cava hypr Kvantum qt5ct qt6ct swappy wallust wlogout; do DIRPATH=~/.config/"$DIR" - if [ -d "$DIRPATH" ]; then + + # Backup the existing directory if it exists + if [ -d "$DIRPATH" ]; then echo -e "${NOTE} - Config for $DIR found, attempting to back up." BACKUP_DIR=$(get_backup_dirname) @@ -352,23 +360,28 @@ for DIR in btop cava hypr Kvantum qt5ct qt6ct swappy wallust wlogout; do mv "$DIRPATH" "$DIRPATH-backup-$BACKUP_DIR" 2>&1 | tee -a "$LOG" if [ $? -eq 0 ]; then echo -e "${NOTE} - Backed up $DIR to $DIRPATH-backup-$BACKUP_DIR." - - # Copy new config - cp -r config/"$DIR" ~/.config/"$DIR" 2>&1 | tee -a "$LOG" - if [ $? -eq 0 ]; then - echo "${OK} - Copy of config for $DIR completed!" - else - echo "${ERROR} - Failed to copy $DIR." - exit 1 - fi else echo "${ERROR} - Failed to back up $DIR." exit 1 fi fi + + # Copy the new config + if [ -d "config/$DIR" ]; then + cp -r "config/$DIR" ~/.config/"$DIR" 2>&1 | tee -a "$LOG" + if [ $? -eq 0 ]; then + echo "${OK} - Copy of config for $DIR completed!" + else + echo "${ERROR} - Failed to copy $DIR." + exit 1 + fi + else + echo "${ERROR} - Directory config/$DIR does not exist to copy." + exit 1 + fi done -printf "\n%.0s" {1..1} +printf "\n" printf "${NOTE} - copying dotfiles second part\n" -- cgit v1.2.3