Phase 2 complete.
This commit is contained in:
75
run.ps1
Normal file
75
run.ps1
Normal file
@@ -0,0 +1,75 @@
|
||||
# EVE Application Run Script for Windows
|
||||
# Starts the Tauri development server with hot-reload
|
||||
|
||||
# Function to print colored output
|
||||
function Write-ColorOutput($ForegroundColor) {
|
||||
$fc = $host.UI.RawUI.ForegroundColor
|
||||
$host.UI.RawUI.ForegroundColor = $ForegroundColor
|
||||
if ($args) {
|
||||
Write-Output $args
|
||||
}
|
||||
$host.UI.RawUI.ForegroundColor = $fc
|
||||
}
|
||||
|
||||
function Log-Info($message) {
|
||||
Write-ColorOutput Cyan "[INFO] $message"
|
||||
}
|
||||
|
||||
function Log-Success($message) {
|
||||
Write-ColorOutput Green "[SUCCESS] $message"
|
||||
}
|
||||
|
||||
function Log-Warning($message) {
|
||||
Write-ColorOutput Yellow "[WARNING] $message"
|
||||
}
|
||||
|
||||
function Log-Error($message) {
|
||||
Write-ColorOutput Red "[ERROR] $message"
|
||||
}
|
||||
|
||||
# Print header
|
||||
Write-Host ""
|
||||
Write-Host "╔════════════════════════════════════════════════════════╗"
|
||||
Write-Host "║ Starting EVE Development Server ║"
|
||||
Write-Host "╚════════════════════════════════════════════════════════╝"
|
||||
Write-Host ""
|
||||
|
||||
# Check if .env exists
|
||||
if (-not (Test-Path ".env")) {
|
||||
Log-Warning ".env file not found"
|
||||
Log-Info "Creating .env from .env.example..."
|
||||
Copy-Item ".env.example" ".env"
|
||||
Log-Info "Please edit .env and add your API keys"
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
# Check if node_modules exists
|
||||
if (-not (Test-Path "node_modules")) {
|
||||
Log-Warning "node_modules not found"
|
||||
Log-Info "Installing dependencies..."
|
||||
npm install
|
||||
Write-Host ""
|
||||
}
|
||||
|
||||
# Create .dev directory if it doesn't exist
|
||||
if (-not (Test-Path ".dev")) {
|
||||
New-Item -ItemType Directory -Path ".dev" -Force | Out-Null
|
||||
}
|
||||
|
||||
# Save PID for kill script
|
||||
$PID | Out-File -FilePath ".dev\run.pid" -Encoding ASCII
|
||||
|
||||
Write-ColorOutput Green "[STARTING] Launching Tauri development server..."
|
||||
Log-Info "Press Ctrl+C to stop the server"
|
||||
Log-Info "Or run: .\kill.ps1"
|
||||
Write-Host ""
|
||||
|
||||
# Start the development server
|
||||
try {
|
||||
npm run tauri:dev
|
||||
} finally {
|
||||
# Cleanup on exit
|
||||
if (Test-Path ".dev\run.pid") {
|
||||
Remove-Item ".dev\run.pid" -Force
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user