Revision 1445 trunk/scripts/admb/root-admb.bat

root-admb.bat (revision 1445)
5 5

  
6 6
setlocal EnableExtensions EnableDelayedExpansion
7 7

  
8
for %%a in (%0) do (
9
  set HAS_PATH=%%~$PATH:a
10
  if defined HAS_PATH (
11
    set ADMB_PATH=%%~dp$PATH:a
12
  ) else (
13
    set ADMB_PATH=%%~dpa
8
set SCRIPT_PATH=%~dp0
9
if not defined SCRIPT_PATH (
10
  for %%a in (%0) do (
11
    set SCRIPT_PATH=%%~dp$PATH:a
14 12
  )
15
  if exist !ADMB_PATH!bin\admb.cmd (
16
    set ADMB_HOME=!ADMB_PATH:~0,-1!
17
    call "!ADMB_HOME!\bin\admb" %*
18
  ) else (
19
    if exist !ADMB_PATH!build\dist\bin\admb.cmd (
20
      set ADMB_HOME=!ADMB_PATH!build\dist
21
      call "!ADMB_HOME!\bin\admb" %*
22
    ) else (
23
      echo "Error: Unable to find ADMB_HOME\bin\admb.cmd."
24
      goto EOF
25
    )
13
) 
14
if not defined SCRIPT_PATH (
15
  echo "SCRIPT_PATH: !SCRIPT_PATH!"
16
  goto ERROR
17
)
18
pushd !SCRIPT_PATH!
19
set ADMB_PATH=!CD!
20
popd
21
if exist !ADMB_PATH!\bin\admb.cmd (
22
  set ADMB_HOME=!ADMB_PATH!
23
) else (
24
  if exist !ADMB_PATH!\build\dist\bin\admb.cmd (
25
    set ADMB_HOME=!ADMB_PATH!\build\dist
26 26
  )
27
  goto EOF
28 27
)
28
if not defined ADMB_HOME (
29
  echo "ADMB_HOME: !ADMB_HOME!"
30
  goto ERROR
31
)
32
call "!ADMB_HOME!\bin\admb" %*
33
goto EOF
34
:ERROR
35
echo Error: Unable to find 'bin\admb.cmd'.
29 36
:EOF

Also available in: Unified diff