diff --git a/install.sh b/install.sh index 06ae4c6..39997b7 100644 --- a/install.sh +++ b/install.sh @@ -1137,6 +1137,40 @@ create_data_directories() { echo "" } +build_upload_tool() { + print_step "打包上传工具..." + + cd "${PROJECT_DIR}/upload-tool" + + # 检查build.sh是否存在 + if [[ ! -f "build.sh" ]]; then + print_warning "build.sh不存在,跳过上传工具打包" + echo "" + return 0 + fi + + # 添加执行权限 + chmod +x build.sh + + # 检查是否已存在exe或可执行文件 + if [[ -f "dist/玩玩云上传工具.exe" ]] || [[ -f "dist/玩玩云上传工具" ]]; then + print_success "上传工具已存在,跳过打包" + echo "" + return 0 + fi + + # 执行打包 + print_info "开始打包上传工具(这可能需要几分钟)..." + if bash build.sh > /dev/null 2>&1; then + print_success "上传工具打包完成" + else + print_warning "上传工具打包失败,用户仍可正常使用SFTP上传" + print_info "如需上传工具,请手动运行: cd ${PROJECT_DIR}/upload-tool && bash build.sh" + fi + + echo "" +} + configure_nginx() { print_step "配置Nginx..." @@ -2173,6 +2207,9 @@ main() { # 创建数据目录 create_data_directories + # 打包上传工具 + build_upload_tool + # 部署SSL证书 deploy_ssl