diff options
| author | JaKooLit <ejhay.games@gmail.com> | 2025-02-21 22:12:09 +0900 |
|---|---|---|
| committer | JaKooLit <ejhay.games@gmail.com> | 2025-02-21 22:12:09 +0900 |
| commit | 32954ef25b2eb8081587e7ea9e3c6e4c5388cd57 (patch) | |
| tree | 32b0f34e4df81447b135ef1983a14071e58b4007 | |
| parent | d676acab0742932e0f52f4816a308abc043eec30 (diff) | |
updated copy.sh
| -rwxr-xr-x | copy.sh | 42 |
1 files changed, 22 insertions, 20 deletions
@@ -583,29 +583,31 @@ HYPR_DIR="$HOME/.config/hypr" BACKUP_DIR=$(get_backup_dirname) BACKUP_HYPR_PATH="$HYPR_DIR-backup-$BACKUP_DIR" -echo -e "\n${NOTE} Restoring ${SKY_BLUE}Animations & Monitor Profiles${RESET} directories into ${YELLOW}$HYPR_DIR${RESET}..." - -DIR_B=("Monitor_Profiles" "animations") -# Restore directories automatically -for DIR_RESTORE in "${DIR_B[@]}"; do - BACKUP_SUBDIR="$BACKUP_HYPR_PATH/$DIR_RESTORE" +if [ -d "$BACKUP_HYPR_PATH" ]; then + echo -e "\n${NOTE} Restoring ${SKY_BLUE}Animations & Monitor Profiles${RESET} directories into ${YELLOW}$HYPR_DIR${RESET}..." - if [ -d "$BACKUP_SUBDIR" ]; then - cp -r "$BACKUP_SUBDIR" "$HYPR_DIR/" - echo "${OK} - Restored directory: ${MAGENTA}$DIR_RESTORE${RESET}" 2>&1 | tee -a "$LOG" - fi -done + DIR_B=("Monitor_Profiles" "animations") + # Restore directories automatically + for DIR_RESTORE in "${DIR_B[@]}"; do + BACKUP_SUBDIR="$BACKUP_HYPR_PATH/$DIR_RESTORE" + + if [ -d "$BACKUP_SUBDIR" ]; then + cp -r "$BACKUP_SUBDIR" "$HYPR_DIR/" + echo "${OK} - Restored directory: ${MAGENTA}$DIR_RESTORE${RESET}" 2>&1 | tee -a "$LOG" + fi + done -# Restore files automatically -FILE_B=("monitors.conf" "workspaces.conf") -for FILE_RESTORE in "${FILE_B[@]}"; do - BACKUP_FILE="$BACKUP_HYPR_PATH/$FILE_RESTORE" + # Restore files automatically + FILE_B=("monitors.conf" "workspaces.conf") + for FILE_RESTORE in "${FILE_B[@]}"; do + BACKUP_FILE="$BACKUP_HYPR_PATH/$FILE_RESTORE" - if [ -f "$BACKUP_FILE" ]; then - cp "$BACKUP_FILE" "$HYPR_DIR/$FILE_RESTORE" - echo "${OK} - Restored file: ${MAGENTA}$FILE_RESTORE${RESET}" 2>&1 | tee -a "$LOG" - fi -done + if [ -f "$BACKUP_FILE" ]; then + cp "$BACKUP_FILE" "$HYPR_DIR/$FILE_RESTORE" + echo "${OK} - Restored file: ${MAGENTA}$FILE_RESTORE${RESET}" 2>&1 | tee -a "$LOG" + fi + done +fi printf "\n%.0s" {1..1} |
