-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathuserweb.cmd
38 lines (29 loc) · 1.13 KB
/
userweb.cmd
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
@echo off
setlocal enabledelayedexpansion
:: AFFECTED FILES:
:: gli\gems.bat
:: gli\gli.bat
:: build.properties.in
:: build.properties
:: build.xml
:: gs3-server.bat
:: gs3-setup.bat
:: userweb.cmd
set INSTALLDIR=!GSDL3SRCHOME!
set USERWEB=
:: Loosely based on http://stackoverflow.com/questions/7708681/how-to-read-from-a-properties-file-using-batch-script
:: Replace forward slashes in web.home with back slashes
:: http://scripts.dragon-it.co.uk/scripts.nsf/docs/batch-search-replace-substitute!OpenDocument&ExpandSection=3&BaseTarget=East&AutoFramed
for /F "tokens=1,2 delims==" %%G in (!GSDL3SRCHOME!\build.properties) do (
if "%%G"=="web.home" set USERWEB=%%H& set USERWEB=!USERWEB:/=\!& goto found
)
:found
echo USERWEB: !USERWEB!
if "!USERWEB!" == "" echo No userweb directory provided & echo. & goto done
:: add exclusion of log folder
robocopy /e "!INSTALLDIR!\web" "!USERWEB!" /xd "!INSTALLDIR!\web\sites\localsite\collect" "!INSTALLDIR!\web\WEB-INF" > CON
robocopy "!INSTALLDIR!\web\WEB-INF" "!USERWEB!\WEB-INF" > CON
md !USERWEB!\sites\localsite\collect
:done
endlocal & set USERWEB=%USERWEB%
:end