source: gli/trunk/fli.bat@ 17534

Last change on this file since 17534 was 16470, checked in by ak19, 16 years ago

FEDORA_VERSION has become the secondary environment variable when running FLI. It has replaced FEDORA2_HOME/FEDORA3_HOME. When running this script, if FEDORA_HOME is set but FEDORA_VERSION isn't, then FEDORA_VERSION will default to 3 along with warning that this has been done.

File size: 1.8 KB
Line 
1@echo off
2
3:: by default, assume English
4set PROGNAME=Fedora Librarian Interface
5if "%GLILANG%" == "es" set PROGNAME=Biblioteca Digital Fedora.
6if "%GLILANG%" == "fr" set PROGNAME=Bibliothécaire Fedora.
7if "%GLILANG%" == "ru" set PROGNAME=ÉÎÔÅÒÆÅÊÓ Fedora.
8:: How to export PROGNAME?
9
10set PROGNAME_EN=Fedora Librarian Interface
11set PROGABBR=FLI
12
13
14echo.
15:: Test to see if FEDORA_HOME environment variable has been set up
16if "%FEDORA_HOME%" == "" goto noFed
17 :: Check if the directory FEDORA_HOME exists
18 :: MAN: Can't use the if command to test directly for a directory, but the null (NUL) device does exist in
19 :: every directory. As a result, you can test for the null device to determine whether a directory exists.
20 if not exist %FEDORA_HOME%\nul echo Error: Cannot find Fedora home. No such directory: %FEDORA_HOME%
21 if not exist %FEDORA_HOME%\nul goto exit
22
23:: If FEDORA_VERSION not set, default fedora-version to 3 after warning user.
24if not "%FEDORA_VERSION%" == "" goto runFed
25 echo FEDORA_VERSION (major version of Fedora) was not set. Defaulting to: 3.
26 echo If you are running a different version of Fedora, set the FEDORA_VERSION
27 echo environment variable.
28 set FEDORA_VERSION="3"
29 echo.
30
31
32:runFed
33:: MAN: The %* batch parameter is a wildcard reference to all the arguments, not including %0,
34:: that are passed to the batch file.
35echo FEDORA_HOME: %FEDORA_HOME%.
36echo FEDORA_VERSION: %FEDORA_VERSION%
37gli.bat -fedora -fedora_home %FEDORA_HOME% -fedora_version %FEDORA_VERSION% %*
38
39:: Either (or both) of FEDORA_HOME and FEDORA_VERSION were not set, both are crucial
40:noFed
41echo Error: Cannot run %PROGNAME_EN% (%PROGABBR%) if FEDORA_HOME is not set.
42goto exit
43
44
45:exit
46echo.
47pause
48
49:done
50:: ---- Clean up ----
51set PROGNAME_EN=
52set PROGABBR=
53set PROGNAME=
Note: See TracBrowser for help on using the repository browser.