forked from 10Dozen/dzn_tSFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtSF_FileSweeper.bat
More file actions
98 lines (82 loc) · 3.33 KB
/
tSF_FileSweeper.bat
File metadata and controls
98 lines (82 loc) · 3.33 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
cls
@echo off
setlocal
: Mission directory
set main=%~dp0
for %%a in (.) do set currentfolder=%%~na
cd %main%
echo #####################################################################
echo # #
echo # tSF File Sweeper (tSF v2.0.13) #
echo # Remove all non-arma files from your mission #
echo # (e.g. html-helpers) and unused tSFramework files #
echo # (according to dzn_tSFramework\Settings.yaml settings) #
echo # #
echo #####################################################################
set /p exitout="Do you want to remove unused files? [y]es [n]o "
if %exitout%==n exit
echo "####### tSF File Sweeper Engaged #######" > tSF_FS_log.txt
echo Mission directory: %main% >> tSF_FS_log.txt
echo Mission fodler name: %currentfolder% >> tSF_FS_log.txt
cd %main%
echo Removing tSF Helpers
echo Removing tSF Helpers >> tSF_FS_log.txt
del /q /f init3DEN.sqf
del /q /f README.md
del /q /f dzn_tSFramework\tS_SettingsOverview.html
del /q /f dzn_tSFramework\Modules\MissionConditions\Helper.html
del /q /f dzn_tSFramework\Modules\Briefing\Helper.html
@RD /S /Q dzn_tSFramework\3DEN
@RD /S /Q dzn_tSFramework\Modules\Briefing\data\helper
@RD /S /Q dzn_tSFramework\Modules\MissionConditions\data\helper
echo Removing DynAI Helpers
echo Removing DynAI Helpers >> tSF_FS_log.txt
@RD /S /Q dzn_dynai\tools
: Clearing unused folders
echo Removing unused tSF Modules
echo Removing unused tSF Modules >> tSF_FS_log.txt
call :removeFolder ACEActions
call :removeFolder AirborneSupport
call :removeFolder ArtillerySupport
call :removeFolder Authorization
call :removeFolder Briefing
call :removeFolder CCP
call :removeFolder Conversations
call :removeFolder Chatter
call :removeFolder CrewOptions
call :removeFolder EditorRadioSettings
call :removeFolder EditorUnitBehavior
call :removeFolder EditorVehicleCrew
call :removeFolder FARP
call :removeFolder Interactives
call :removeFolder IntroText
call :removeFolder JIPTeleport
call :removeFolder MissionConditions
call :removeFolder MissionDefaults
call :removeFolder POM
call :removeFolder Respawn
call :removeFolder tSAdminTools
call :removeFolder tSNotes
call :removeFolder tSSettings
echo #####################################################################
echo # #
echo # tSF File Sweeper has finished his work. #
echo # All non-arma files were removed. Have a nice day! #
echo # #
echo #####################################################################
del /q /f tSFS_temp.txt
del /q /f tSFS_temp2.txt
echo Done! >> tSF_FS_log.txt
( del /q /f "%~f0" >nul 2>&1 & exit /b 0 )
pause
exit
:removeFolder
set tsfparam="%1"
set tsffolder=%1
findstr /c:%tsfparam% dzn_tSFramework\Settings.yaml > tSFS_temp.txt
findstr "true" tSFS_temp.txt > tSFS_temp2.txt
for /f %%i in ("tSFS_temp2.txt") do set size=%%~zi
if NOT %size% gtr 0 (
echo Folder is not used: Removing %tsffolder% >> tSF_FS_log.txt
@RD /S /Q dzn_tSFramework\Modules\%tsffolder%
)