diff options
author | Karl Berry <karl@freefriends.org> | 2019-04-01 21:07:31 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-04-01 21:07:31 +0000 |
commit | ca790e6da556783aa072a2b1d21eee01b100ec32 (patch) | |
tree | 226da3ee026929e682fb4f71fa403a42487ae758 /Master/texmf-dist/scripts/webquiz/webquiz.bat | |
parent | b9279e1b4ddf93b0d93a9f62ba3335fc2386cebb (diff) |
webquiz (1apr19)
git-svn-id: svn://tug.org/texlive/trunk@50694 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/webquiz/webquiz.bat')
-rwxr-xr-x | Master/texmf-dist/scripts/webquiz/webquiz.bat | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/Master/texmf-dist/scripts/webquiz/webquiz.bat b/Master/texmf-dist/scripts/webquiz/webquiz.bat index c92a60d3a29..89c05730fa4 100755 --- a/Master/texmf-dist/scripts/webquiz/webquiz.bat +++ b/Master/texmf-dist/scripts/webquiz/webquiz.bat @@ -1,14 +1,30 @@ @echo off +rem WebQuiz batch file to find and launch python executable + +rem Set TEXMF to root TeX directory and look for webquiz.py in scripts/webquiz setlocal enableextensions -rem assuming the main script is in the same directory -if not exist "%~dpn0.py" ( - echo %~nx0: main script "%~dpn0.py" not found>&2 +for /F "tokens=*" %%i in ('kpsewhich -var-value TEXMFMAIN') do (SET TEXMF=%%i) + +rem First look for webquiz.py in the current directory +set WebQuiz="webquiz.py" +if not exist %WebQuiz% ( + if exist "%TEXMF%/scripts/webquiz/webquiz.py" ( + set WebQuiz="%TEXMF%/scripts/webquiz/webquiz.py" + ) +) +rem +rem exit with an error if webquiz.py has not been found +if not exist %WebQuiz% ( + echo WebQuiz executable not found. Please check that WebQuiz is properly installed>&2 exit /b 1 ) -rem check if interpreter is on the PATH + +rem check for the python interpreter in the PATH for %%I in (python.exe) do set "PYTHONEXE=%%~$PATH:I" if not defined PYTHONEXE ( echo %~nx0: Python interpreter not installed or not on the PATH>&2 exit /b 1 ) -"%PYTHONEXE%" "%~dpn0.py" %* + +rem launch webquiz +"%PYTHONEXE%" %WebQuiz% %* |