-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean.ps1
More file actions
25 lines (18 loc) · 1.14 KB
/
Copy pathclean.ps1
File metadata and controls
25 lines (18 loc) · 1.14 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
$ErrorActionPreference = "Stop"
function Step($msg) {
Write-Host "[clean] $msg"
}
Step "Cleaning project data and temporary files..."
# Resolve paths relative to this script.
$sourceDir = Resolve-Path $PSScriptRoot
# Wipe saved data.
Remove-Item -Force -ErrorAction SilentlyContinue (Join-Path $sourceDir "config.json"), (Join-Path $sourceDir "state.json")
Get-ChildItem -Path $sourceDir -Filter "config.json.bak_*" -ErrorAction SilentlyContinue | Remove-Item -Force -ErrorAction SilentlyContinue
Get-ChildItem -Path $sourceDir -Filter "state.json.backup_*" -ErrorAction SilentlyContinue | Remove-Item -Force -ErrorAction SilentlyContinue
# Remove Python caches.
Get-ChildItem -Path $sourceDir -Recurse -Directory -Filter __pycache__ -ErrorAction SilentlyContinue |
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue
# Remove build artifacts.
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue (Join-Path $sourceDir "build"), (Join-Path $sourceDir "dist"), (Join-Path $sourceDir "release")
Get-ChildItem -Path $sourceDir -Filter "*.spec" -ErrorAction SilentlyContinue | Remove-Item -Force -ErrorAction SilentlyContinue
Step "Clean complete."