mirror of
https://github.com/yuaotian/go-cursor-help.git
synced 2025-06-08 12:32:06 +08:00
feat: Add macOS system check and configuration restore feature to Cursor MAC ID modifier
- Implemented system check to ensure script runs only on macOS - Added new restore functionality to recover previous configuration from backups - Enhanced script with user-friendly backup file selection - Improved error handling and system compatibility
This commit is contained in:
parent
8dff3e96c6
commit
b4fd75079c
@ -536,8 +536,29 @@ modify_mac_address() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# 新增恢复功能选项
|
||||||
|
add_restore_feature() {
|
||||||
|
local backup_files=("$BACKUP_DIR"/*.backup_*)
|
||||||
|
echo "可用的备份文件:"
|
||||||
|
select backup in "${backup_files[@]}"; do
|
||||||
|
if [ -n "$backup" ]; then
|
||||||
|
cp "$backup" "$STORAGE_FILE"
|
||||||
|
log_info "已从备份恢复配置"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
# 主函数
|
# 主函数
|
||||||
main() {
|
main() {
|
||||||
|
|
||||||
|
# 新增环境检查
|
||||||
|
if [[ $(uname) != "Darwin" ]]; then
|
||||||
|
log_error "本脚本仅支持 macOS 系统"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
clear
|
clear
|
||||||
# 显示 Logo
|
# 显示 Logo
|
||||||
echo -e "
|
echo -e "
|
||||||
@ -586,6 +607,9 @@ main() {
|
|||||||
log_info "请重启 Cursor 以应用新的配置"
|
log_info "请重启 Cursor 以应用新的配置"
|
||||||
# 显示最后的提示信息
|
# 显示最后的提示信息
|
||||||
show_follow_info
|
show_follow_info
|
||||||
|
|
||||||
|
# 新增恢复功能选项
|
||||||
|
restore_feature
|
||||||
}
|
}
|
||||||
|
|
||||||
# 执行主函数
|
# 执行主函数
|
||||||
|
Loading…
x
Reference in New Issue
Block a user