-
Notifications
You must be signed in to change notification settings - Fork 0
/
dev.bat
41 lines (31 loc) · 1.31 KB
/
dev.bat
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
echo off
setlocal enabledelayedexpansion
echo The current directory is %CD%
rem #============ Variables ============#
rem List of modules to zip
set list=initFEWSForecast NSSDownload WaveDownload PreProcessXBeach PostProcessXBeach IndicatorsXBeach WipeForecast PreProcessRegional RegionalForecast
(for %%a in (%list%) do (
rem #============ Paths ============#
set MOD_NAME=%%a
set DEV_PATH=.\Modules\!MOD_NAME!_dev
set DEST_PATH=.\Modules\!MOD_NAME!
set ZIP_PATH=.\Modules\!MOD_NAME!.zip
set DATA_PATH=.\Config\ModuleDataSetFiles\
rem #============ Remove previous directory ============#
if exist !DEST_PATH! RD /S /Q !DEST_PATH!
rem #============ Copy and rename dev directory ============#
xcopy /s /i !DEV_PATH! !DEST_PATH!
rem #============ Remove any unwanted files ============#
set DIAG_FILE=!DEST_PATH!\diag.xml
IF EXIST !DIAG_FILE! DEL /F !DIAG_FILE!
set LOG_FILE=!DEST_PATH!\exceptions.log
IF EXIST !LOG_FILE! DEL /F !LOG_FILE!
set NC_PATH=!DEST_PATH!\ncFiles
IF EXIST !NC_PATH! DEL /F /Q !NC_PATH!
rem #============ Zip File ============#
7z a !ZIP_PATH! !DEST_PATH!
rem #============ Remove folder that was just zipped ============#
RD /S /Q !DEST_PATH!
rem #============ Remove folder that was just zipped ============#
move !ZIP_PATH! !DATA_PATH!
))