cfgdeploy
finally, modernization in this year old project
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
# Simple helper script to get structDir from project config.json
|
||||
# Reads config.json from .config folder in project root
|
||||
|
||||
param(
|
||||
[string]$ProjectRoot
|
||||
)
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($ProjectRoot)) {
|
||||
# Try to determine project root from script location
|
||||
if ($PSScriptRoot) {
|
||||
$ProjectRoot = Split-Path -Parent $PSScriptRoot
|
||||
}
|
||||
elseif ($MyInvocation.MyCommand.Path) {
|
||||
$ProjectRoot = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path)
|
||||
}
|
||||
else {
|
||||
Write-Error "Unable to determine project root. Please provide -ProjectRoot parameter."
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
$configPath = Join-Path -Path $ProjectRoot -ChildPath '.config\config.json'
|
||||
|
||||
if (-not (Test-Path -LiteralPath $configPath -PathType Leaf)) {
|
||||
Write-Error "config.json not found at: $configPath"
|
||||
exit 1
|
||||
}
|
||||
|
||||
try {
|
||||
$config = Get-Content -LiteralPath $configPath -Raw -ErrorAction Stop | ConvertFrom-Json
|
||||
|
||||
if ($config.PSObject.Properties.Name -contains 'structDir') {
|
||||
$structDir = $config.structDir
|
||||
if ($null -ne $structDir -and ($structDir -isnot [string] -or $structDir.Trim().Length -gt 0)) {
|
||||
# If it's an absolute path, resolve it
|
||||
if ([System.IO.Path]::IsPathRooted($structDir)) {
|
||||
$resolved = Resolve-Path -LiteralPath $structDir -ErrorAction SilentlyContinue
|
||||
if ($null -ne $resolved) {
|
||||
Write-Output $resolved.Path
|
||||
exit 0
|
||||
}
|
||||
Write-Output $structDir
|
||||
exit 0
|
||||
}
|
||||
# Relative path - resolve relative to config location
|
||||
$candidate = Join-Path -Path (Split-Path -Parent $configPath) -ChildPath $structDir
|
||||
$resolvedCandidate = Resolve-Path -LiteralPath $candidate -ErrorAction SilentlyContinue
|
||||
if ($null -ne $resolvedCandidate) {
|
||||
Write-Output $resolvedCandidate.Path
|
||||
exit 0
|
||||
}
|
||||
Write-Output $candidate
|
||||
exit 0
|
||||
}
|
||||
}
|
||||
|
||||
# Default: return the directory containing config.json (project root)
|
||||
Write-Output $ProjectRoot
|
||||
exit 0
|
||||
}
|
||||
catch {
|
||||
Write-Error "Failed to read or parse config.json: $($_.Exception.Message)"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"dailyFormat": "YYYY-MM-DD",
|
||||
"structDir": "C:\\Users\\Nathan\\SynologyDrive\\Creative\\artsy\\maya\\0 ProjectStructure",
|
||||
"zipper": "7z",
|
||||
"compression": 0,
|
||||
"Max7zInst": 0,
|
||||
"zipsegLimit": "2G"
|
||||
}
|
||||
+121
-6
@@ -1,15 +1,130 @@
|
||||
# Git LFS attributes configuration
|
||||
# All listed file types will be tracked by Git LFS
|
||||
|
||||
# Video files
|
||||
*.avi filter=lfs diff=lfs merge=lfs -text
|
||||
*.mkv filter=lfs diff=lfs merge=lfs -text
|
||||
*.mov filter=lfs diff=lfs merge=lfs -text
|
||||
*.MOV filter=lfs diff=lfs merge=lfs -text
|
||||
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||
*.webm filter=lfs diff=lfs merge=lfs -text
|
||||
# Image files
|
||||
*.bmp filter=lfs diff=lfs merge=lfs -text
|
||||
*.exr filter=lfs diff=lfs merge=lfs -text
|
||||
*.gif filter=lfs diff=lfs merge=lfs -text
|
||||
*.hdr filter=lfs diff=lfs merge=lfs -text
|
||||
*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||
*.jpeg filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.tga filter=lfs diff=lfs merge=lfs -text
|
||||
*.tif filter=lfs diff=lfs merge=lfs -text
|
||||
*.tiff filter=lfs diff=lfs merge=lfs -text
|
||||
*.webp filter=lfs diff=lfs merge=lfs -text
|
||||
*.heic filter=lfs diff=lfs merge=lfs -text
|
||||
*.HEIC filter=lfs diff=lfs merge=lfs -text
|
||||
# 3D/CG files
|
||||
*.3ds filter=lfs diff=lfs merge=lfs -text
|
||||
*.abc filter=lfs diff=lfs merge=lfs -text
|
||||
*.blend filter=lfs diff=lfs merge=lfs -text
|
||||
*.blend1 filter=lfs diff=lfs merge=lfs -text
|
||||
*.blend2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.bvh filter=lfs diff=lfs merge=lfs -text
|
||||
*.bvh.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.c4d filter=lfs diff=lfs merge=lfs -text
|
||||
*.dae filter=lfs diff=lfs merge=lfs -text
|
||||
*.fbx filter=lfs diff=lfs merge=lfs -text
|
||||
*.fbxkey filter=lfs diff=lfs merge=lfs -text
|
||||
*.ma filter=lfs diff=lfs merge=lfs -text
|
||||
*.max filter=lfs diff=lfs merge=lfs -text
|
||||
*.mb filter=lfs diff=lfs merge=lfs -text
|
||||
*.obj filter=lfs diff=lfs merge=lfs -text
|
||||
*.usd filter=lfs diff=lfs merge=lfs -text
|
||||
*.usdz filter=lfs diff=lfs merge=lfs -text
|
||||
*.vdb filter=lfs diff=lfs merge=lfs -text
|
||||
*.bphys filter=lfs diff=lfs merge=lfs -text
|
||||
*.bobj filter=lfs diff=lfs merge=lfs -text
|
||||
*.bvel filter=lfs diff=lfs merge=lfs -text
|
||||
*.bpointcache filter=lfs diff=lfs merge=lfs -text
|
||||
*.blob filter=lfs diff=lfs merge=lfs -text
|
||||
*.unitypackage filter=lfs diff=lfs merge=lfs -text
|
||||
# Character Creator files (Reallusion)
|
||||
*.ccAvatar filter=lfs diff=lfs merge=lfs -text
|
||||
*.ccProject filter=lfs diff=lfs merge=lfs -text
|
||||
*.ccCloth filter=lfs diff=lfs merge=lfs -text
|
||||
*.ccProp filter=lfs diff=lfs merge=lfs -text
|
||||
*.ccScene filter=lfs diff=lfs merge=lfs -text
|
||||
*.ccHair filter=lfs diff=lfs merge=lfs -text
|
||||
*.rlMotion filter=lfs diff=lfs merge=lfs -text
|
||||
*.rlPose filter=lfs diff=lfs merge=lfs -text
|
||||
*.iAvatar filter=lfs diff=lfs merge=lfs -text
|
||||
*.iMotion filter=lfs diff=lfs merge=lfs -text
|
||||
*.iProp filter=lfs diff=lfs merge=lfs -text
|
||||
*.iMaterial filter=lfs diff=lfs merge=lfs -text
|
||||
*.rlHead filter=lfs diff=lfs merge=lfs -text
|
||||
*.rlHair filter=lfs diff=lfs merge=lfs -text
|
||||
*.rlScene filter=lfs diff=lfs merge=lfs -text
|
||||
*.rlSkintex filter=lfs diff=lfs merge=lfs -text
|
||||
# Houdini files
|
||||
*.hiplc filter=lfs diff=lfs merge=lfs -text
|
||||
*.bgeo filter=lfs diff=lfs merge=lfs -text
|
||||
*.bgeo.sc filter=lfs diff=lfs merge=lfs -text
|
||||
# Flip Fluids cache files
|
||||
*.data filter=lfs diff=lfs merge=lfs -text
|
||||
*.sqlite3 filter=lfs diff=lfs merge=lfs -text
|
||||
*.ffp3 filter=lfs diff=lfs merge=lfs -text
|
||||
# Substance files
|
||||
*.sbs filter=lfs diff=lfs merge=lfs -text
|
||||
*.sbsar filter=lfs diff=lfs merge=lfs -text
|
||||
*.spp filter=lfs diff=lfs merge=lfs -text
|
||||
# Audio files
|
||||
*.mp3 filter=lfs diff=lfs merge=lfs -text
|
||||
*.wav filter=lfs diff=lfs merge=lfs -text
|
||||
*.m4a filter=lfs diff=lfs merge=lfs -text
|
||||
*.aac filter=lfs diff=lfs merge=lfs -text
|
||||
*.ogg filter=lfs diff=lfs merge=lfs -text
|
||||
*.flac filter=lfs diff=lfs merge=lfs -text
|
||||
# Archive/Compression files
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.cursorindexingignore filter=lfs diff=lfs merge=lfs -text
|
||||
*.gitignore filter=lfs diff=lfs merge=lfs -text
|
||||
*.md filter=lfs diff=lfs merge=lfs -text
|
||||
*.7z.[0-9][0-9][0-9] filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.rar filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
# Documents
|
||||
*.docx filter=lfs diff=lfs merge=lfs -text
|
||||
*.xlsx filter=lfs diff=lfs merge=lfs -text
|
||||
*.eps filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
# Adobe files
|
||||
*.aegraphic filter=lfs diff=lfs merge=lfs -text
|
||||
*.aep filter=lfs diff=lfs merge=lfs -text
|
||||
*.prel filter=lfs diff=lfs merge=lfs -text
|
||||
*.prin filter=lfs diff=lfs merge=lfs -text
|
||||
*.prmf filter=lfs diff=lfs merge=lfs -text
|
||||
*.prproj filter=lfs diff=lfs merge=lfs -text
|
||||
*.py filter=lfs diff=lfs merge=lfs -text
|
||||
*.ai filter=lfs diff=lfs merge=lfs -text
|
||||
*.psd filter=lfs diff=lfs merge=lfs -text
|
||||
*.pk filter=lfs diff=lfs merge=lfs -text
|
||||
*.pkf filter=lfs diff=lfs merge=lfs -text
|
||||
# Davinci Resolve files
|
||||
*.dpx filter=lfs diff=lfs merge=lfs -text
|
||||
*.drp filter=lfs diff=lfs merge=lfs -text
|
||||
# Data files
|
||||
*.h5 filter=lfs diff=lfs merge=lfs -text
|
||||
*.hdf5 filter=lfs diff=lfs merge=lfs -text
|
||||
# Other
|
||||
*.uni filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdn filter=lfs diff=lfs merge=lfs -text
|
||||
*.pur filter=lfs diff=lfs merge=lfs -text
|
||||
*.db filter=lfs diff=lfs merge=lfs -text
|
||||
*.raw filter=lfs diff=lfs merge=lfs -text
|
||||
*.lnk filter=lfs diff=lfs merge=lfs -text
|
||||
# Python files
|
||||
*.npz filter=lfs diff=lfs merge=lfs -text
|
||||
# Adobe Alternatives
|
||||
*.xcf filter=lfs diff=lfs merge=lfs -text
|
||||
*.af filter=lfs diff=lfs merge=lfs -text
|
||||
*.gitignore !text !filter !merge !diff
|
||||
*.cursorindexingignore !text !filter !merge !diff
|
||||
*.md !text !filter !merge !diff
|
||||
|
||||
+134
-9
@@ -1,9 +1,134 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:500397b1550a8c58e0710b51d6b9807630bbd48cb167c6f27bbddcf9ee6c7f27
|
||||
size 1582
|
||||
|
||||
.specstory/
|
||||
|
||||
_archive/
|
||||
|
||||
.vscode/
|
||||
# Blender Studio Git Management - .gitignore
|
||||
|
||||
# Blender auto-save files
|
||||
*.blend1
|
||||
*.blend2
|
||||
*.blend3
|
||||
*.blend4
|
||||
*.blend5
|
||||
*.blend6
|
||||
*.blend7
|
||||
*.blend8
|
||||
*.blend9
|
||||
*.blend10
|
||||
*.blend11
|
||||
*.blend12
|
||||
*.blend13
|
||||
*.blend14
|
||||
*.blend15
|
||||
*.blend16
|
||||
*.blend17
|
||||
*.blend18
|
||||
*.blend19
|
||||
*.blend20
|
||||
*.blend21
|
||||
*.blend22
|
||||
*.blend23
|
||||
*.blend24
|
||||
*.blend25
|
||||
*.blend26
|
||||
*.blend27
|
||||
*.blend28
|
||||
*.blend29
|
||||
*.blend30
|
||||
*.blend31
|
||||
*.blend32
|
||||
|
||||
# Blender cache and temporary files
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
*.tmp
|
||||
*.temp
|
||||
BL_proxy/
|
||||
|
||||
# OS generated files
|
||||
.DS_Store
|
||||
.DS_Store?
|
||||
._*
|
||||
.Spotlight-V100
|
||||
.Trashes
|
||||
ehthumbs.db
|
||||
Thumbs.db
|
||||
desktop.ini
|
||||
|
||||
# Editor files
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
.specstory/
|
||||
.cursorindexingignore
|
||||
|
||||
# Large media files (uncomment if you want to exclude rendered outputs)
|
||||
# *.mp4
|
||||
# *.avi
|
||||
# *.mov
|
||||
# *.png
|
||||
# *.jpg
|
||||
# *.jpeg
|
||||
# *.exr
|
||||
# *.hdr
|
||||
# *.tiff
|
||||
# *.tga
|
||||
|
||||
# Audio files (uncomment if excluding)
|
||||
# *.wav
|
||||
# *.mp3
|
||||
# *.aac
|
||||
# *.ogg
|
||||
|
||||
# Log files
|
||||
*.log
|
||||
|
||||
# Python cache
|
||||
__pycache__/
|
||||
*.pyc
|
||||
*.pyo
|
||||
*.pyd
|
||||
.Python
|
||||
|
||||
# Node modules (if using any web tools)
|
||||
node_modules/
|
||||
|
||||
# Environment files
|
||||
.env
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
# Backup files
|
||||
*.bak
|
||||
*.backup
|
||||
*.old
|
||||
|
||||
# Temporary files
|
||||
temp/
|
||||
tmp/
|
||||
cache/
|
||||
|
||||
Renders/**
|
||||
!Renders/_zipped/
|
||||
!Renders/_zipped/**
|
||||
!Renders/**/
|
||||
!Renders/**/*.bat
|
||||
!Renders/**/*.log
|
||||
seq/
|
||||
|
||||
# Premiere
|
||||
*.prlock
|
||||
Adobe Premiere Pro Video Previews/
|
||||
Adobe Premiere Pro Audio Previews/
|
||||
Adobe Premiere Pro (Beta) Video Previews/
|
||||
Adobe Premiere Pro (Beta) Audio Previews/
|
||||
footage/
|
||||
plates/
|
||||
|
||||
RnR/
|
||||
|
||||
# Microsoft Office temporary files
|
||||
~$*
|
||||
|
||||
_archive/
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
@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 CfgDeploy.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 CfgDeploy.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 'compress_sequence_pngs.py'; if (-not (Test-Path -LiteralPath $pyPath)) { throw \"compress_sequence_pngs.py not found at $pyPath\" }; Write-Output $pyPath"`) do set "PY_SCRIPT=%%~I"
|
||||
|
||||
if not defined PY_SCRIPT (
|
||||
echo [ERROR] Unable to resolve compress_sequence_pngs.py path from config.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
pushd "%PROJ_ROOT%" >nul 2>&1
|
||||
|
||||
python "%PY_SCRIPT%" %*
|
||||
set "ERR=!ERRORLEVEL!"
|
||||
|
||||
popd >nul 2>&1
|
||||
|
||||
if !ERR! NEQ 0 (
|
||||
echo PNG compression failed ^(exit code !ERR!^).
|
||||
exit /b !ERR!
|
||||
)
|
||||
|
||||
exit /b 0
|
||||
@@ -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 CfgDeploy.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 CfgDeploy.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!
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
@echo off
|
||||
setlocal EnableExtensions
|
||||
|
||||
set "script_dir=%~dp0"
|
||||
set "current_dir=%CD%"
|
||||
set "PROJ_ROOT="
|
||||
|
||||
REM First, check project level (one directory up from current) - most common case
|
||||
for %%I in ("%current_dir%..") do set "project_level=%%~fI"
|
||||
set "project_config=%project_level%\.config\config.json"
|
||||
if exist "%project_config%" (
|
||||
set "PROJ_ROOT=%project_level%"
|
||||
)
|
||||
|
||||
REM If not found at project level, search up from current working directory
|
||||
if not defined PROJ_ROOT (
|
||||
for /f "usebackq delims=" %%I in (`powershell -NoProfile -ExecutionPolicy Bypass -Command "Set-StrictMode -Version Latest; $dir = '%current_dir%'; $found = $null; while ($dir -and -not $found) { $configPath = Join-Path $dir '.config\config.json'; if (Test-Path -LiteralPath $configPath) { $found = $dir; break }; $parent = Split-Path -Parent $dir; if ($parent -eq $dir) { break }; $dir = $parent }; if ($found) { Write-Output $found } else { Write-Output '' }"`) do set "PROJ_ROOT=%%I"
|
||||
)
|
||||
|
||||
REM If still not found, try searching from script location
|
||||
if not defined PROJ_ROOT (
|
||||
for /f "usebackq delims=" %%I in (`powershell -NoProfile -ExecutionPolicy Bypass -Command "Set-StrictMode -Version Latest; $dir = '%script_dir%'; $found = $null; while ($dir -and -not $found) { $configPath = Join-Path $dir '.config\config.json'; if (Test-Path -LiteralPath $configPath) { $found = $dir; break }; $parent = Split-Path -Parent $dir; if ($parent -eq $dir) { break }; $dir = $parent }; if ($found) { Write-Output $found } else { Write-Output '' }"`) do set "PROJ_ROOT=%%I"
|
||||
)
|
||||
|
||||
REM Fallback: try original logic (script in 3 ProjectStructure)
|
||||
if not defined PROJ_ROOT (
|
||||
for %%I in ("%script_dir%..\..") do set "PROJ_ROOT=%%~fI"
|
||||
)
|
||||
|
||||
set "CONFIG_DIR=%PROJ_ROOT%\.config"
|
||||
set "CONFIG_PATH=%CONFIG_DIR%\config.json"
|
||||
|
||||
if not exist "%CONFIG_PATH%" (
|
||||
echo [ERROR] config.json not found at %CONFIG_PATH%
|
||||
if defined project_config (
|
||||
echo Also checked: %project_config%
|
||||
)
|
||||
echo Please run CfgDeploy.ps1 to deploy helper files.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
set "GET_STRUCT_DIR=%CONFIG_DIR%\GetStructDir.ps1"
|
||||
|
||||
if not exist "%GET_STRUCT_DIR%" (
|
||||
echo [ERROR] GetStructDir.ps1 not found at %GET_STRUCT_DIR%
|
||||
echo Please run CfgDeploy.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\" }; $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"
|
||||
|
||||
if not defined ps1 (
|
||||
echo [ERROR] Unable to resolve UpdateSequences.ps1 path from config.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
REM Run from batch directory (sequences next to batch, or submodule root)
|
||||
set "WORK_DIR=%script_dir%"
|
||||
if "%WORK_DIR:~-1%"=="\" set "WORK_DIR=%WORK_DIR:~0,-1%"
|
||||
pushd "%WORK_DIR%" >nul 2>&1
|
||||
|
||||
echo Running PowerShell update script in %WORK_DIR%...
|
||||
powershell -NoProfile -ExecutionPolicy Bypass -File "%ps1%"
|
||||
set "rc=%errorlevel%"
|
||||
|
||||
popd >nul 2>&1
|
||||
echo PowerShell exited with RC=%rc%
|
||||
echo Done.
|
||||
pause >nul
|
||||
exit /b %rc%
|
||||
@@ -0,0 +1,44 @@
|
||||
@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 CfgDeploy.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 CfgDeploy.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%" --verbose %*
|
||||
set "ERR=!ERRORLEVEL!"
|
||||
|
||||
popd >nul 2>&1
|
||||
|
||||
if !ERR! NEQ 0 (
|
||||
echo Failed to update render sequence archives ^(exit code !ERR!^).
|
||||
exit /b !ERR!
|
||||
)
|
||||
|
||||
exit /b 0
|
||||
|
||||
Reference in New Issue
Block a user