Projekt for SPIE - Avatar for safety briefing / managment event
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

100 lines
2.8 KiB

@echo off
setlocal EnableExtensions EnableDelayedExpansion
rem ============================================================
rem Mirror specific folders from A (AvatarBase) to B (this repo)
rem - Works relative to this .bat location
rem - Wipes extras in destination (/MIR)
rem - Logs removed extras (shown as *EXTRA File / *EXTRA Dir)
rem - Pauses before exit so console stays open
rem ============================================================
rem Destination root is the folder where this script lives
set "DST_ROOT=%~dp0"
if "%DST_ROOT:~-1%"=="\" set "DST_ROOT=%DST_ROOT:~0,-1%"
rem Source root relative to this script
set "SRC_ROOT=%DST_ROOT%\..\..\AvatarBase\Unreal"
rem Canonicalize paths
for %%I in ("%SRC_ROOT%") do set "SRC_ROOT=%%~fI"
for %%I in ("%DST_ROOT%") do set "DST_ROOT=%%~fI"
echo ============================================================
echo Robocopy Sync Script
echo ============================================================
echo Source: %SRC_ROOT%
echo Destination: %DST_ROOT%
echo ============================================================
echo.
rem Guard: only intended for subprojects
if /I "%SRC_ROOT%"=="%DST_ROOT%" (
echo ERROR: Source and destination are identical:
echo %SRC_ROOT%
echo This sync script is intended to be run from subprojects only.
echo.
pause
exit /b 1
)
if not exist "%SRC_ROOT%\" (
echo ERROR: Source root does not exist:
echo %SRC_ROOT%
echo.
pause
exit /b 2
)
rem List of folders to mirror
set "FOLDERS=Plugins\AvatarCore_AI Plugins\AvatarCore_Shared Plugins\AvatarCore_Manager Plugins\AvatarCore_MetaHuman Plugins\AvatarCore_STT Plugins\AvatarCore_TTS Plugins\BLogger Plugins\BSettings Plugins\BTools Plugins\RuntimeMetaHumanLipSync_5.6 Content\Project"
set "ANY_FAIL=0"
for %%F in (%FOLDERS%) do (
set "SRC=%SRC_ROOT%\%%F"
set "DST=%DST_ROOT%\%%F"
echo ------------------------------------------------------------
echo Mirroring: %%F
echo FROM: !SRC!
echo TO: !DST!
echo ------------------------------------------------------------
if not exist "!SRC!\" (
echo WARNING: Source folder missing, skipping: !SRC!
) else (
if not exist "!DST!\" (
mkdir "!DST!" 2>nul
)
robocopy "!SRC!" "!DST!" /MIR /DCOPY:DAT /COPY:DAT /R:2 /W:1 /FFT /Z /NP /FP /TS /TEE
set "RC=!ERRORLEVEL!"
echo Robocopy exit code: !RC!
if !RC! GEQ 8 (
echo ERROR: Robocopy reported failure for %%F ^(exit code !RC!^)
set "ANY_FAIL=1"
)
)
echo.
)
if "!ANY_FAIL!"=="1" (
echo ============================================================
echo Sync failed!
echo ============================================================
pause
exit /b 8
)
echo ============================================================
echo Sync finished.
echo ============================================================
pause
exit /b 0