File size: 4,695 Bytes
09fa60b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# AudioForge Prerequisites Checker
# Verifies all required services are running before starting

$Colors = @{
    Red = "Red"
    Green = "Green"
    Yellow = "Yellow"
    Blue = "Cyan"
    Cyan = "Cyan"
}

function Write-Info { Write-Host "[INFO] $args" -ForegroundColor $Colors.Blue }
function Write-Success { Write-Host "[SUCCESS] $args" -ForegroundColor $Colors.Green }
function Write-Warning { Write-Host "[WARNING] $args" -ForegroundColor $Colors.Yellow }
function Write-Error { Write-Host "[ERROR] $args" -ForegroundColor $Colors.Red }

Write-Host "`n╔═══════════════════════════════════════════════════════════╗" -ForegroundColor Cyan
Write-Host "β•‘      AudioForge Prerequisites Checker                    β•‘" -ForegroundColor Cyan
Write-Host "β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•`n" -ForegroundColor Cyan

$allGood = $true

# Check Docker
Write-Info "Checking Docker Desktop..."
try {
    $dockerVersion = docker --version 2>&1
    if ($LASTEXITCODE -eq 0) {
        Write-Success "Docker found: $dockerVersion"
        
        # Check if Docker daemon is running
        try {
            $null = docker ps 2>&1 | Out-Null
            if ($LASTEXITCODE -eq 0) {
                Write-Success "Docker daemon is running"
            } else {
                Write-Error "Docker daemon is NOT running!"
                Write-Warning "Please start Docker Desktop and try again"
                $allGood = $false
            }
        } catch {
            Write-Error "Cannot connect to Docker daemon"
            Write-Warning "Please start Docker Desktop and try again"
            $allGood = $false
        }
    } else {
        Write-Error "Docker not found!"
        Write-Warning "Please install Docker Desktop from https://www.docker.com/products/docker-desktop"
        $allGood = $false
    }
} catch {
    Write-Error "Docker not found in PATH"
    Write-Warning "Please install Docker Desktop from https://www.docker.com/products/docker-desktop"
    $allGood = $false
}

# Check Python
Write-Info "Checking Python..."
try {
    $pythonVersion = python --version 2>&1
    if ($LASTEXITCODE -eq 0) {
        Write-Success "Python found: $pythonVersion"
    } else {
        Write-Error "Python not found!"
        $allGood = $false
    }
} catch {
    Write-Error "Python not found in PATH"
    $allGood = $false
}

# Check Node.js
Write-Info "Checking Node.js..."
try {
    $nodeVersion = node --version 2>&1
    if ($LASTEXITCODE -eq 0) {
        Write-Success "Node.js found: $nodeVersion"
    } else {
        Write-Error "Node.js not found!"
        $allGood = $false
    }
} catch {
    Write-Error "Node.js not found in PATH"
    $allGood = $false
}

# Check pnpm
Write-Info "Checking pnpm..."
try {
    $pnpmVersion = pnpm --version 2>&1
    if ($LASTEXITCODE -eq 0) {
        Write-Success "pnpm found: v$pnpmVersion"
    } else {
        Write-Warning "pnpm not found, will install automatically"
    }
} catch {
    Write-Warning "pnpm not found, will install automatically"
}

Write-Host ""

if ($allGood) {
    Write-Host "╔═══════════════════════════════════════════════════════════╗" -ForegroundColor Green
    Write-Host "β•‘         βœ… All Prerequisites Satisfied! βœ…                β•‘" -ForegroundColor Green
    Write-Host "β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•`n" -ForegroundColor Green
    Write-Info "You can now run: .\scripts\dev_start.ps1"
    exit 0
} else {
    Write-Host "╔═══════════════════════════════════════════════════════════╗" -ForegroundColor Red
    Write-Host "β•‘         ❌ Prerequisites Not Met ❌                        β•‘" -ForegroundColor Red
    Write-Host "β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•`n" -ForegroundColor Red
    Write-Info "Please fix the issues above and run this script again"
    exit 1
}