@echo off setlocal enabledelayedexpansion set LUAC=C:\EgtProg\Dll32\luac54.exe set ROOT=%cd%\ set OUTBASE=bin if not exist %OUTBASE% mkdir %OUTBASE% REM Compile all .lua files excluding bin\ and any dot folders/files for /f "delims=" %%F in ('dir /b /s /a-d *.lua ^| findstr /v /i /c:"\%OUTBASE%\"') do ( set FULL=%%F set REL=!FULL:%ROOT%=! REM Skip if REL starts with '.' or contains '\.' echo !REL! | findstr /r /c:"^\." /c:"\\\." >nul if errorlevel 1 ( set OUT=%OUTBASE%\!REL! for %%D in ("!OUT!") do mkdir "%%~dpD" 2>nul echo Compiling: !REL! %LUAC% -o "!OUT!" -s "!FULL!" ) else ( echo Skipping hidden/dot path: !REL! ) ) REM Copy all .json files excluding bin\ and any dot folders/files for /f "delims=" %%F in ('dir /b /s /a-d *.json ^| findstr /v /i /c:"\%OUTBASE%\"') do ( set FULL=%%F set REL=!FULL:%ROOT%=! REM Skip if REL starts with '.' or contains '\.' echo !REL! | findstr /r /c:"^\." /c:"\\\." >nul if errorlevel 1 ( set OUT=%OUTBASE%\!REL! for %%D in ("!OUT!") do mkdir "%%~dpD" 2>nul echo Copying: !REL! copy /Y "!FULL!" "!OUT!" >nul ) else ( echo Skipping hidden/dot path: !REL! ) ) echo Done. pause