source: main/trunk/greenstone3/userweb.cmd@ 32188

Last change on this file since 32188 was 30574, checked in by ak19, 8 years ago

Improving dispersed GS3: changes to util.pm fix the bug whereby the perl code always write to gs2build\tmp when building, even if the Greenstone folder is not writable. Now the TMP env var location is used and the tmp files get written to TMP\greenstone\web when the GS folder is not writable. Further tidied up bat and cmd files to remove extra variables, to break out of loop reading in build.properties file when the necessary properties are found.

File size: 1.1 KB
Line 
1@echo off
2setlocal enabledelayedexpansion
3
4:: AFFECTED FILES:
5:: gli\gems.bat
6:: gli\gli.bat
7:: build.properties.in
8:: build.properties
9:: build.xml
10:: gs3-server.bat
11:: gs3-setup.bat
12:: userweb.cmd
13
14set INSTALLDIR=!GSDL3SRCHOME!
15set USERWEB=
16
17:: Loosely based on http://stackoverflow.com/questions/7708681/how-to-read-from-a-properties-file-using-batch-script
18:: Replace forward slashes in web.home with back slashes
19:: http://scripts.dragon-it.co.uk/scripts.nsf/docs/batch-search-replace-substitute!OpenDocument&ExpandSection=3&BaseTarget=East&AutoFramed
20for /F "tokens=1,2 delims==" %%G in (!GSDL3SRCHOME!\build.properties) do (
21 if "%%G"=="web.home" set USERWEB=%%H& set USERWEB=!USERWEB:/=\!& goto found
22)
23
24:found
25echo USERWEB: !USERWEB!
26
27if "!USERWEB!" == "" echo No userweb directory provided & echo. & goto done
28
29:: add exclusion of log folder
30robocopy /e "!INSTALLDIR!\web" "!USERWEB!" /xd "!INSTALLDIR!\web\sites\localsite\collect" "!INSTALLDIR!\web\WEB-INF" > CON
31robocopy "!INSTALLDIR!\web\WEB-INF" "!USERWEB!\WEB-INF" > CON
32md !USERWEB!\sites\localsite\collect
33
34
35:done
36endlocal & set USERWEB=%USERWEB%
37
38:end
Note: See TracBrowser for help on using the repository browser.