Browse Source

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
pull/231/head v0.0.89
煎饼果子卷鲨鱼辣椒 4 months ago
parent
commit
3f3d0a6533
  1. 6
      scripts/run/cursor_mac_id_modifier.sh

6
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

Loading…
Cancel
Save