Files
ProjectStructure_HOME/ZipSeqArchv.bat

43 lines
1.4 KiB
Batchfile
Raw Normal View History

2025-11-06 10:10:29 -07:00
@echo off
2025-11-10 11:27:44 -07:00
setlocal EnableExtensions EnableDelayedExpansion
2025-11-06 10:10:29 -07:00
2025-11-06 11:02:59 -07:00
set "REN_DIR=%~dp0"
for %%I in ("%REN_DIR%..") do set "PROJ_ROOT=%%~fI"
2025-11-06 10:10:29 -07:00
set "CONFIG_DIR=%PROJ_ROOT%\.config"
set "CONFIG_PATH=%CONFIG_DIR%\config.json"
set "GET_STRUCT_DIR=%CONFIG_DIR%\GetStructDir.ps1"
2025-11-08 02:36:20 -07:00
if not exist "%CONFIG_PATH%" (
echo [ERROR] config.json not found at %CONFIG_PATH%
2025-11-10 15:47:05 -07:00
echo Please run ConfigLoader.ps1 to deploy helper files.
2025-11-08 02:36:20 -07:00
exit /b 1
)
if not exist "%GET_STRUCT_DIR%" (
echo [ERROR] GetStructDir.ps1 not found at %GET_STRUCT_DIR%
2025-11-10 15:47:05 -07:00
echo Please run ConfigLoader.ps1 to deploy helper files.
2025-11-08 02:36:20 -07:00
exit /b 1
)
for /f "usebackq delims=" %%I in (`powershell -NoProfile -ExecutionPolicy Bypass -Command ^
"Set-StrictMode -Version Latest; $structDir = & '%GET_STRUCT_DIR%' -ProjectRoot '%PROJ_ROOT%'; if (-not $structDir) { throw \"Failed to get structDir from GetStructDir.ps1\" }; $pyPath = Join-Path $structDir 'zip_sequences.py'; if (-not (Test-Path -LiteralPath $pyPath)) { throw \"zip_sequences.py not found at $pyPath\" }; Write-Output $pyPath"`) do set "PY_SCRIPT=%%I"
2025-11-08 02:36:20 -07:00
if not defined PY_SCRIPT (
echo [ERROR] Unable to resolve zip_sequences.py path from config.
2025-11-06 10:10:29 -07:00
exit /b 1
)
2025-11-06 11:02:59 -07:00
pushd "%PROJ_ROOT%" >nul 2>&1
2025-11-06 10:10:29 -07:00
python "%PY_SCRIPT%" --verbose %*
2025-11-10 11:27:44 -07:00
set "ERR=!ERRORLEVEL!"
2025-11-06 10:10:29 -07:00
2025-11-10 11:27:44 -07:00
if not "!ERR!"=="0" (
echo Failed to update render sequence archives (exit code !ERR!).
2025-11-06 10:10:29 -07:00
)
popd >nul 2>&1
2025-11-10 11:27:44 -07:00
exit /b !ERR!
2025-11-06 10:10:29 -07:00