1
1
# scripts/prepare-binaries.ps1
2
- Write-Host " 🔧 Preparing DevStackBox binaries for release..." - ForegroundColor Green
2
+ Write-Host " Preparing DevStackBox binaries for release..." - ForegroundColor Green
3
3
4
- # Ensure src-tauri directory structure for bundling
5
4
$srcTauriPath = " src-tauri"
5
+ $componentsFound = 0
6
+ $componentsTotal = 6
6
7
7
- # Copy all server components to src-tauri for bundling
8
- Write-Host " 📦 Copying server components..." - ForegroundColor Blue
8
+ Write-Host " Copying server components..." - ForegroundColor Blue
9
9
10
10
# Copy Apache
11
11
if (Test-Path " apache" ) {
12
- Write-Host " ✅ Copying Apache binaries..."
12
+ Write-Host " Copying Apache binaries..."
13
13
if (Test-Path " $srcTauriPath /apache" ) {
14
14
Remove-Item " $srcTauriPath /apache" - Recurse - Force
15
15
}
16
16
Copy-Item - Path " apache" - Destination " $srcTauriPath /apache" - Recurse - Force
17
+ $componentsFound ++
18
+ } else {
19
+ New-Item - ItemType Directory - Force - Path " $srcTauriPath /apache" | Out-Null
20
+ New-Item - ItemType File - Force - Path " $srcTauriPath /apache/README.txt" - Value " Placeholder for Apache component" | Out-Null
21
+ Write-Host " Created placeholder for Apache" - ForegroundColor Yellow
17
22
}
18
23
19
24
# Copy MySQL
20
25
if (Test-Path " mysql" ) {
21
- Write-Host " ✅ Copying MySQL binaries..."
22
- Copy-Item - Path " mysql" - Destination " $srcTauriPath /mysql" - Recurse - Force
23
- # Exclude runtime data but keep structure
24
- if (Test-Path " $srcTauriPath /mysql/data" ) {
25
- Remove-Item " $srcTauriPath /mysql/data/*" - Recurse - Force - ErrorAction SilentlyContinue
26
+ Write-Host " Copying MySQL binaries..."
27
+ if (Test-Path " $srcTauriPath /mysql" ) {
28
+ Remove-Item " $srcTauriPath /mysql" - Recurse - Force
26
29
}
30
+ Copy-Item - Path " mysql" - Destination " $srcTauriPath /mysql" - Recurse - Force
31
+ $componentsFound ++
32
+ } else {
33
+ New-Item - ItemType Directory - Force - Path " $srcTauriPath /mysql" | Out-Null
34
+ New-Item - ItemType File - Force - Path " $srcTauriPath /mysql/README.txt" - Value " Placeholder for MySQL component" | Out-Null
35
+ Write-Host " Created placeholder for MySQL" - ForegroundColor Yellow
27
36
}
28
37
29
38
# Copy PHP
30
39
if (Test-Path " php" ) {
31
- Write-Host " ✅ Copying PHP binaries..."
32
- Copy-Item - Path " php" - Destination " $srcTauriPath /php" - Recurse - Force
33
- # Exclude sessions but keep structure
34
- if (Test-Path " $srcTauriPath /php/sessions" ) {
35
- Remove-Item " $srcTauriPath /php/sessions/*" - Force - ErrorAction SilentlyContinue
40
+ Write-Host " Copying PHP binaries..."
41
+ if (Test-Path " $srcTauriPath /php" ) {
42
+ Remove-Item " $srcTauriPath /php" - Recurse - Force
36
43
}
44
+ Copy-Item - Path " php" - Destination " $srcTauriPath /php" - Recurse - Force
45
+ $componentsFound ++
46
+ } else {
47
+ New-Item - ItemType Directory - Force - Path " $srcTauriPath /php" | Out-Null
48
+ New-Item - ItemType File - Force - Path " $srcTauriPath /php/README.txt" - Value " Placeholder for PHP component" | Out-Null
49
+ Write-Host " Created placeholder for PHP" - ForegroundColor Yellow
37
50
}
38
51
39
52
# Copy phpMyAdmin
40
53
if (Test-Path " phpmyadmin" ) {
41
- Write-Host " ✅ Copying phpMyAdmin..."
42
- Copy-Item - Path " phpmyadmin" - Destination " $srcTauriPath /phpmyadmin" - Recurse - Force
43
- # Exclude temp files but keep structure
44
- @ (" tmp" , " upload" , " save" ) | ForEach-Object {
45
- $tempPath = " $srcTauriPath /phpmyadmin/$_ "
46
- if (Test-Path $tempPath ) {
47
- Remove-Item " $tempPath /*" - Force - ErrorAction SilentlyContinue
48
- } else {
49
- New-Item - ItemType Directory - Path $tempPath - Force | Out-Null
50
- }
54
+ Write-Host " Copying phpMyAdmin..."
55
+ if (Test-Path " $srcTauriPath /phpmyadmin" ) {
56
+ Remove-Item " $srcTauriPath /phpmyadmin" - Recurse - Force
51
57
}
58
+ Copy-Item - Path " phpmyadmin" - Destination " $srcTauriPath /phpmyadmin" - Recurse - Force
59
+ $componentsFound ++
60
+ } else {
61
+ New-Item - ItemType Directory - Force - Path " $srcTauriPath /phpmyadmin" | Out-Null
62
+ New-Item - ItemType File - Force - Path " $srcTauriPath /phpmyadmin/README.txt" - Value " Placeholder for phpMyAdmin component" | Out-Null
63
+ Write-Host " Created placeholder for phpMyAdmin" - ForegroundColor Yellow
52
64
}
53
65
54
66
# Copy www directory
55
67
if (Test-Path " www" ) {
56
- Write-Host " ✅ Copying www directory..."
68
+ Write-Host " Copying www directory..."
69
+ if (Test-Path " $srcTauriPath /www" ) {
70
+ Remove-Item " $srcTauriPath /www" - Recurse - Force
71
+ }
57
72
Copy-Item - Path " www" - Destination " $srcTauriPath /www" - Recurse - Force
73
+ $componentsFound ++
74
+ } else {
75
+ New-Item - ItemType Directory - Force - Path " $srcTauriPath /www" | Out-Null
76
+ New-Item - ItemType File - Force - Path " $srcTauriPath /www/README.txt" - Value " Placeholder for WWW component" | Out-Null
77
+ $indexContent = ' <html><head><title>DevStackBox</title></head><body><h1>DevStackBox</h1><p>Ready!</p></body></html>'
78
+ New-Item - ItemType File - Force - Path " $srcTauriPath /www/index.html" - Value $indexContent | Out-Null
79
+ Write-Host " Created placeholder for WWW" - ForegroundColor Yellow
58
80
}
59
81
60
82
# Copy config files
61
83
if (Test-Path " config" ) {
62
- Write-Host " ✅ Copying configuration files..."
84
+ Write-Host " Copying configuration files..."
85
+ if (Test-Path " $srcTauriPath /config" ) {
86
+ Remove-Item " $srcTauriPath /config" - Recurse - Force
87
+ }
63
88
Copy-Item - Path " config" - Destination " $srcTauriPath /config" - Recurse - Force
89
+ $componentsFound ++
90
+ } else {
91
+ New-Item - ItemType Directory - Force - Path " $srcTauriPath /config" | Out-Null
92
+ New-Item - ItemType File - Force - Path " $srcTauriPath /config/README.txt" - Value " Placeholder for Config component" | Out-Null
93
+ Write-Host " Created placeholder for Config" - ForegroundColor Yellow
94
+ }
95
+
96
+ Write-Host " "
97
+ Write-Host " Component Summary:" - ForegroundColor Cyan
98
+ Write-Host " Total components: $componentsTotal "
99
+ Write-Host " Found and copied: $componentsFound " - ForegroundColor Green
100
+ Write-Host " Placeholders created: $ ( $componentsTotal - $componentsFound ) " - ForegroundColor Yellow
101
+
102
+ if ($componentsFound -eq 0 ) {
103
+ Write-Host " "
104
+ Write-Host " Warning: No server components found in repository!" - ForegroundColor Yellow
105
+ Write-Host " Building with placeholder files only." - ForegroundColor Yellow
64
106
}
65
107
108
+ Write-Host " "
66
109
Write-Host " All binaries prepared for bundling!" - ForegroundColor Green
67
- Write-Host " Ready to run: npm run tauri build" - ForegroundColor Yellow
110
+ Write-Host " Ready to run: npm run tauri build" - ForegroundColor Yellow
0 commit comments