9cadb26603
- corretta compilazione per evitare ripetizione direttorio destinazione bin sotto se stesso e per copiare immagini e messaggi.
56 lines
1.4 KiB
Batchfile
56 lines
1.4 KiB
Batchfile
@echo off
|
|
setlocal enabledelayedexpansion
|
|
|
|
set LUAC=C:\EgtProg\Dll32\luac54.exe
|
|
set ROOT=%cd%\
|
|
set OUTBASE=bin
|
|
|
|
rmdir /s /q "%ROOT%\%OUTBASE%"
|
|
|
|
if not exist %OUTBASE% mkdir %OUTBASE%
|
|
|
|
xcopy "%ROOT%\Images" "%ROOT%\%OUTBASE%\Images" /E /H /C /I /Y
|
|
|
|
xcopy "%ROOT%\Messages" "%ROOT%\%OUTBASE%\Messages" /E /H /C /I /Y
|
|
|
|
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
|