-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathclean.ps1
More file actions
42 lines (34 loc) · 1.23 KB
/
clean.ps1
File metadata and controls
42 lines (34 loc) · 1.23 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
Param(
[string] $modName, # mod folder name
[string] $srcDirectory, # the path that contains your mod's .XCOM_sln
[string] $sdkPath, # the path to your SDK installation ending in "XCOM 2 War of the Chosen SDK"
[string] $gamePath # the path to your XCOM 2 installation ending in "XCOM2-WaroftheChosen"
)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version 3.0
if ($null -eq $modName -or $modName -eq "") {
throw "`$modName empty???"
}
Write-Host "Deleting all cached build artifacts..."
$files = @(
"$sdkPath\XComGame\lastBuildDetails.json",
"$sdkPath\XComGame\Script\*.u",
"$sdkPath\XComGame\ScriptFinalRelease\*.u",
"$sdkPath\XComGame\Content\LocalShaderCache-PC-D3D-SM4.upk"
)
$folders = @(
"$srcDirectory\BuildCache",
"$sdkPath\Development\Src\*",
"$sdkPath\XComGame\Mods\*",
"$gamePath\XComGame\Mods\$modName",
"$sdkPath\XComGame\Published"
)
$files | ForEach-Object {
Write-Host "Removing file(s) $($_)"
Remove-Item -Force $_ -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
}
$folders | ForEach-Object {
Write-Host "Removing folders(s) $($_)"
Remove-Item -Recurse -Force $_ -WarningAction SilentlyContinue -ErrorAction SilentlyContinue
}
Write-Host "Cleaned."