Add cross-platform support and clean up obsolete files
- Add electron-packager scripts for Windows, macOS, and Linux - Include universal architecture support for macOS - Add electron:package:all for building all platforms - Remove obsolete start-backend.sh script (replaced by Electron auto-start) - Improve ignore patterns to exclude repo-images folder - Add platform-specific icon configurations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,11 @@
|
||||
"electron": "electron .",
|
||||
"electron:dev": "npm run build:backend && NODE_ENV=development electron .",
|
||||
"electron:build": "npm run build && electron-builder",
|
||||
"electron:package": "npm run build && electron-packager . Termix --platform=win32 --arch=x64 --out=release --overwrite --ignore=\"^/src|^/public|^/node_modules\" --prune=true",
|
||||
"electron:package": "npm run build && electron-packager . Termix --platform=win32 --arch=x64 --out=release --overwrite --ignore=\"^/src|^/public|^/node_modules|^/repo-images\" --prune=true --icon=public/favicon.ico",
|
||||
"electron:package:win": "npm run build && electron-packager . Termix --platform=win32 --arch=x64 --out=release --overwrite --ignore=\"^/src|^/public|^/node_modules|^/repo-images\" --prune=true --icon=public/favicon.ico",
|
||||
"electron:package:mac": "npm run build && electron-packager . Termix --platform=darwin --arch=universal --out=release --overwrite --ignore=\"^/src|^/public|^/node_modules|^/repo-images\" --prune=true --icon=public/icon.png",
|
||||
"electron:package:linux": "npm run build && electron-packager . Termix --platform=linux --arch=x64 --out=release --overwrite --ignore=\"^/src|^/public|^/node_modules|^/repo-images\" --prune=true --icon=public/icon.png",
|
||||
"electron:package:all": "npm run build && npm run electron:package:win && npm run electron:package:mac && npm run electron:package:linux",
|
||||
"dist": "npm run build && electron-builder --publish=never",
|
||||
"dist:win": "npm run dist -- --win",
|
||||
"dist:mac": "npm run dist -- --mac",
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Starting Termix Backend Services..."
|
||||
|
||||
# 设置环境变量
|
||||
export NODE_ENV=${NODE_ENV:-production}
|
||||
export DATA_PATH=${DATA_PATH:-./data}
|
||||
|
||||
# 检查是否已经构建
|
||||
if [ ! -d "dist/backend" ]; then
|
||||
echo "Building backend..."
|
||||
npm run build:backend
|
||||
fi
|
||||
|
||||
# 检查端口是否被占用的函数
|
||||
check_port() {
|
||||
local port=$1
|
||||
if lsof -Pi :$port -sTCP:LISTEN -t >/dev/null 2>&1; then
|
||||
echo "Port $port is already in use"
|
||||
return 1
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# 启动所有后端服务
|
||||
echo "Starting backend services..."
|
||||
echo "- Database API (8081)"
|
||||
echo "- WebSocket Terminal (8082)"
|
||||
echo "- Tunnel Management (8083)"
|
||||
echo "- File Manager (8084)"
|
||||
echo "- Server Statistics (8085)"
|
||||
|
||||
# 检查关键端口
|
||||
for port in 8081 8082 8083 8084 8085; do
|
||||
if ! check_port $port; then
|
||||
echo "Error: Port $port is in use. Please stop the conflicting service."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# 启动主服务(会自动启动所有其他服务)
|
||||
echo "Starting all services via starter.js..."
|
||||
node dist/backend/starter.js
|
||||
Reference in New Issue
Block a user