-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathclean-all-examples.ps1
More file actions
45 lines (41 loc) · 1.55 KB
/
clean-all-examples.ps1
File metadata and controls
45 lines (41 loc) · 1.55 KB
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
# clean-all-examples.ps1
# Remove all built example binaries and unit output
$exampleBin = "example-bin"
if (Test-Path $exampleBin) {
Write-Host "🧹 Removing example-bin/ directory..." -ForegroundColor Yellow
Remove-Item $exampleBin -Recurse -Force
Write-Host "✅ example-bin/ cleaned." -ForegroundColor Green
} else {
Write-Host "ℹ️ example-bin/ does not exist. Nothing to clean." -ForegroundColor Gray
}
$examples = @(
'ColorDemo',
'ErrorHandlingDemo',
'LongRunningOpDemo',
'ProgressDemo',
'SimpleDemo',
'SubCommandDemo'
)
foreach ($ex in $examples) {
$libPath = "examples/$ex/lib"
if (Test-Path $libPath) {
Write-Host "🧹 Removing old lib/ from examples/$ex..." -ForegroundColor Yellow
Remove-Item $libPath -Recurse -Force
}
$win64Path = "examples/$ex/x86_64-win64"
if (Test-Path $win64Path) {
Write-Host "🧹 Removing old x86_64-win64/ from examples/$ex..." -ForegroundColor Yellow
Remove-Item $win64Path -Recurse -Force
}
$linuxPath = "examples/$ex/x86_64-linux"
if (Test-Path $linuxPath) {
Write-Host "🧹 Removing old x86_64-linux/ from examples/$ex..." -ForegroundColor Yellow
Remove-Item $linuxPath -Recurse -Force
}
$backupPath = "examples/$ex/backup"
if (Test-Path $backupPath) {
Write-Host "🧹 Cleaning backup/ in examples/$ex..." -ForegroundColor Yellow
Get-ChildItem $backupPath -Include *.exe,*.dbg,*.o,*.ppu -Recurse | Remove-Item -Force
}
}
Write-Host "`n✅ Cleanup complete." -ForegroundColor Green