summaryrefslogtreecommitdiff
path: root/Master/bin/win32
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-02-08 00:38:37 +0000
committerKarl Berry <karl@freefriends.org>2013-02-08 00:38:37 +0000
commit532e95c1171566e596e733b2f12b60263d3773db (patch)
treea28c86920edec0518ca9d924a4dbe993099a0502 /Master/bin/win32
parent26d5dc00f5d6880985f5ae779b786f5ea001bb2f (diff)
lua2dox 0.2 (7feb13)
git-svn-id: svn://tug.org/texlive/trunk@29053 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/bin/win32')
-rwxr-xr-xMaster/bin/win32/lua2dox_filter.bat69
1 files changed, 69 insertions, 0 deletions
diff --git a/Master/bin/win32/lua2dox_filter.bat b/Master/bin/win32/lua2dox_filter.bat
new file mode 100755
index 00000000000..a75d2eb6746
--- /dev/null
+++ b/Master/bin/win32/lua2dox_filter.bat
@@ -0,0 +1,69 @@
+@echo off
+
+:init
+
+ rem Avoid clobbering anyone else's variables
+
+ setlocal
+
+ rem Safety precaution against awkward paths
+
+ cd /d "%~dp0"
+
+:main
+
+ call :set_lua
+ if ERRORLEVEL 1 (
+ goto :end
+ )
+
+ set BASENAME=%~n0
+ set DIRNAME=%~dp0
+
+ set LUASCRIPT=%DIRNAME%\lua2dox.lua %BASENAME%
+
+ if not [%*] == [] (
+ echo %*
+ )
+ %EXE% %LUASCRIPT% %*
+
+ goto :end
+
+:set_lua
+
+ call :exe-search texlua
+
+ if not defined EXE (
+ call :exe-search lua
+ )
+
+ if not defined EXE (
+ echo No Lua interpreter available
+ exit /b 1
+ )
+
+ goto :EOF
+
+:exe-search
+
+ set PATHCOPY=%PATH%
+
+:exe-search-loop
+
+ rem Search for a binary
+
+ if defined EXE goto :EOF
+
+ for /f "delims=; tokens=1,2*" %%I in ("%PATHCOPY%") do (
+ if exist "%%I\%1.exe" (
+ set EXE=%1
+ )
+ set PATHCOPY=%%J;%%K
+ )
+ if not "%PATHCOPY%" == ";" goto :exe-search-loop
+
+ exit /b 1
+
+ goto :EOF
+
+:end \ No newline at end of file