From c94d1eaa79e97bb0dc65c40151049baeb41053a4 Mon Sep 17 00:00:00 2001 From: Raincloud Date: Mon, 10 Nov 2025 19:22:23 -0700 Subject: [PATCH] append zipseq batches --- Renders/NewDaily.bat | 16 ------- Renders/UnzipSeqArchv.bat | 42 +++++++++++++++++++ .../{UpdateSequences.bat => ZipSeqArchv.bat} | 31 ++++++++------ 3 files changed, 60 insertions(+), 29 deletions(-) delete mode 100644 Renders/NewDaily.bat create mode 100644 Renders/UnzipSeqArchv.bat rename Renders/{UpdateSequences.bat => ZipSeqArchv.bat} (51%) diff --git a/Renders/NewDaily.bat b/Renders/NewDaily.bat deleted file mode 100644 index ec6596b..0000000 --- a/Renders/NewDaily.bat +++ /dev/null @@ -1,16 +0,0 @@ -@echo off -setlocal - -:: Get current date in YYYY-MM-DD format -for /f "tokens=2-4 delims=/ " %%a in ('date /t') do ( - set mm=%%a - set dd=%%b - set yy=%%c -) -set yyyy=20%yy:~-2% - -:: Create daily folder -mkdir "%yyyy%-%mm%-%dd%" -echo Daily folder created: %yyyy%-%mm%-%dd% - -pause diff --git a/Renders/UnzipSeqArchv.bat b/Renders/UnzipSeqArchv.bat new file mode 100644 index 0000000..acfcc33 --- /dev/null +++ b/Renders/UnzipSeqArchv.bat @@ -0,0 +1,42 @@ +@echo off +setlocal EnableExtensions EnableDelayedExpansion + +set "REN_DIR=%~dp0" +for %%I in ("%REN_DIR%..") do set "PROJ_ROOT=%%~fI" + +set "CONFIG_DIR=%PROJ_ROOT%\.config" +set "CONFIG_PATH=%CONFIG_DIR%\config.json" +set "GET_STRUCT_DIR=%CONFIG_DIR%\GetStructDir.ps1" + +if not exist "%CONFIG_PATH%" ( + echo [ERROR] config.json not found at %CONFIG_PATH% + echo Please run ConfigLoader.ps1 to deploy helper files. + exit /b 1 +) + +if not exist "%GET_STRUCT_DIR%" ( + echo [ERROR] GetStructDir.ps1 not found at %GET_STRUCT_DIR% + echo Please run ConfigLoader.ps1 to deploy helper files. + 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" + +if not defined PY_SCRIPT ( + echo [ERROR] Unable to resolve zip_sequences.py path from config. + exit /b 1 +) + +pushd "%PROJ_ROOT%" >nul 2>&1 + +python "%PY_SCRIPT%" --mode expand --verbose %* +set "ERR=!ERRORLEVEL!" + +if not "!ERR!"=="0" ( + echo Failed to expand render sequence archives (exit code !ERR!). +) + +popd >nul 2>&1 +exit /b !ERR! + diff --git a/Renders/UpdateSequences.bat b/Renders/ZipSeqArchv.bat similarity index 51% rename from Renders/UpdateSequences.bat rename to Renders/ZipSeqArchv.bat index 1d2b268..7908c7a 100644 --- a/Renders/UpdateSequences.bat +++ b/Renders/ZipSeqArchv.bat @@ -1,8 +1,8 @@ @echo off -setlocal EnableExtensions +setlocal EnableExtensions EnableDelayedExpansion -set "script_dir=%~dp0" -for %%I in ("%script_dir%..\..") do set "PROJ_ROOT=%%~fI" +set "REN_DIR=%~dp0" +for %%I in ("%REN_DIR%..") do set "PROJ_ROOT=%%~fI" set "CONFIG_DIR=%PROJ_ROOT%\.config" set "CONFIG_PATH=%CONFIG_DIR%\config.json" @@ -21,17 +21,22 @@ if not exist "%GET_STRUCT_DIR%" ( ) 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\" }; $ps1Path = Join-Path $structDir 'UpdateSequences.ps1'; if (-not (Test-Path -LiteralPath $ps1Path)) { throw \"UpdateSequences.ps1 not found at $ps1Path\" }; Write-Output $ps1Path"`) do set "ps1=%%I" + "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" -if not defined ps1 ( - echo [ERROR] Unable to resolve UpdateSequences.ps1 path from config. +if not defined PY_SCRIPT ( + echo [ERROR] Unable to resolve zip_sequences.py path from config. exit /b 1 ) -echo Running PowerShell update script... -powershell -NoProfile -ExecutionPolicy Bypass -File "%ps1%" -set "rc=%errorlevel%" -echo PowerShell exited with RC=%rc% -echo Done. -pause >nul -exit /b %rc% +pushd "%PROJ_ROOT%" >nul 2>&1 + +python "%PY_SCRIPT%" --verbose %* +set "ERR=!ERRORLEVEL!" + +if not "!ERR!"=="0" ( + echo Failed to update render sequence archives (exit code !ERR!). +) + +popd >nul 2>&1 +exit /b !ERR! +