mirror of
https://github.com/yuaotian/go-cursor-help.git
synced 2025-06-08 12:32:06 +08:00
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
This commit is contained in:
parent
2bb74b41e0
commit
3f3d0a6533
@ -542,7 +542,7 @@ restore_feature() {
|
|||||||
if [ ! -d "$BACKUP_DIR" ]; then
|
if [ ! -d "$BACKUP_DIR" ]; then
|
||||||
log_warn "备份目录不存在"
|
log_warn "备份目录不存在"
|
||||||
return 1
|
return 1
|
||||||
}
|
fi
|
||||||
|
|
||||||
# 使用find命令获取备份文件列表
|
# 使用find命令获取备份文件列表
|
||||||
mapfile -t backup_files < <(find "$BACKUP_DIR" -name "*.backup_*" -type f 2>/dev/null | sort)
|
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
|
if [ ${#backup_files[@]} -eq 0 ]; then
|
||||||
log_warn "未找到任何备份文件"
|
log_warn "未找到任何备份文件"
|
||||||
return 1
|
return 1
|
||||||
}
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
log_info "可用的备份文件:"
|
log_info "可用的备份文件:"
|
||||||
@ -585,7 +585,7 @@ restore_feature() {
|
|||||||
if [ ! -f "$selected_backup" ] || [ ! -r "$selected_backup" ]; then
|
if [ ! -f "$selected_backup" ] || [ ! -r "$selected_backup" ]; then
|
||||||
log_error "无法访问选择的备份文件"
|
log_error "无法访问选择的备份文件"
|
||||||
return 1
|
return 1
|
||||||
}
|
fi
|
||||||
|
|
||||||
# 尝试恢复配置
|
# 尝试恢复配置
|
||||||
if cp "$selected_backup" "$STORAGE_FILE"; then
|
if cp "$selected_backup" "$STORAGE_FILE"; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user