-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCleanup.bat
More file actions
61 lines (52 loc) · 1.28 KB
/
Copy pathCleanup.bat
File metadata and controls
61 lines (52 loc) · 1.28 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
@echo off
echo *** Memoryator Cleanup Folders 1.0 ***
echo Starting Cleanup...
pushd "%~dp0"
CALL :rmSafe .\.vs
CALL :rmSafe .\Memoryator.sln
CALL :rmSafe .\.vscode
CALL :rmSafe .\Memoryator.code-workspace
CALL :rmSafe .\Plugins\Runtime\HoudiniEngine
IF "%1" == "--keep-config" (
CALL :rmSafe .\Saved\Autosaves
CALL :rmSafe .\Saved\Backup
CALL :rmSafe .\Saved\Cooked
CALL :rmSafe .\Saved\Shaders
CALL :rmSafe .\Saved\StagedBuilds
CALL :rmSafe .\Saved\Temp
) ELSE (
CALL :rmSafe .\Saved
)
CALL :cleanupIntermediate .
CALL :cleanupIntermediate Plugins\GameAnalytics
CALL :cleanupIntermediate Plugins\MirrorAnimationSystem
CALL :cleanupIntermediate Plugins\UE4PopcornFXPlugin\PopcornFX
CALL :cleanupIntermediate Plugins\VivoxCoreUE4Plugin
CALL :cleanupIntermediate Plugins\Wwise
popd
echo Done.
EXIT /B %ERRORLEVEL%
:cleanupIntermediate
CALL :rmSafe %1\Binaries
CALL :rmSafe %1\Intermediate
EXIT /B 0
:rmSafe
CALL :getPathType %1
IF %ERRORLEVEL% == 0 (
echo Deleting folder: %1
rmdir %1 /S /Q
) else if %ERRORLEVEL% == 1 (
echo Deleting file: %1
del %1
)
EXIT /B 0
:getPathType
FOR /f "tokens=1,2 delims=d" %%A in ("-%~a1") do if "%%B" neq "" (
:: Is folder
EXIT /B 0
) else if "%%A" neq "-" (
:: Is file
EXIT /B 1
)
:: Does not exist
EXIT /B 2