From 3f3d0a6533663d90ea0d4d039bdf3f7f83f02a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=85=8E=E9=A5=BC=E6=9E=9C=E5=AD=90=E5=8D=B7=E9=B2=A8?= =?UTF-8?q?=E9=B1=BC=E8=BE=A3=E6=A4=92?= Date: Sat, 8 Feb 2025 15:49:08 +0800 Subject: [PATCH] fix: Correct syntax errors in restore feature function - Fixed missing `fi` statements in conditional blocks - Resolved shell script syntax issues in `restore_feature()` - Ensured proper control flow and error handling in backup restoration logic --- scripts/run/cursor_mac_id_modifier.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/run/cursor_mac_id_modifier.sh b/scripts/run/cursor_mac_id_modifier.sh index 473288d..c7ff479 100644 --- a/scripts/run/cursor_mac_id_modifier.sh +++ b/scripts/run/cursor_mac_id_modifier.sh @@ -542,7 +542,7 @@ restore_feature() { if [ ! -d "$BACKUP_DIR" ]; then log_warn "备份目录不存在" return 1 - } + fi # 使用find命令获取备份文件列表 mapfile -t backup_files < <(find "$BACKUP_DIR" -name "*.backup_*" -type f 2>/dev/null | sort) @@ -551,7 +551,7 @@ restore_feature() { if [ ${#backup_files[@]} -eq 0 ]; then log_warn "未找到任何备份文件" return 1 - } + fi echo log_info "可用的备份文件:" @@ -585,7 +585,7 @@ restore_feature() { if [ ! -f "$selected_backup" ] || [ ! -r "$selected_backup" ]; then log_error "无法访问选择的备份文件" return 1 - } + fi # 尝试恢复配置 if cp "$selected_backup" "$STORAGE_FILE"; then