-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild_Clean.ps1
More file actions
30 lines (23 loc) · 887 Bytes
/
Build_Clean.ps1
File metadata and controls
30 lines (23 loc) · 887 Bytes
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
Write-Host "==============================================="
Write-Host " AutoFire — Clean build folders & processes"
Write-Host "==============================================="
# Stop running EXE if present
Write-Host "Stopping any running AutoFire.exe ..."
Get-Process AutoFire -ErrorAction SilentlyContinue | Stop-Process -Force
Start-Sleep -Milliseconds 600
# Close leftover handles from PowerShell launching the EXE (best effort)
$null = Get-Process AutoFire -ErrorAction SilentlyContinue | Stop-Process -Force
# Clean build output
function SafeRemove($path) {
if (Test-Path $path) {
try {
Remove-Item $path -Recurse -Force -ErrorAction Stop
Write-Host "Removed $path"
} catch {
Write-Warning "Could not remove $path: $($_.Exception.Message)"
}
}
}
SafeRemove ".\dist\AutoFire"
SafeRemove ".\build\AutoFire"
Write-Host "Clean step done."