2025-08-08 13:33:08 -06:00
@ echo off
2025-08-18 19:31:09 -06:00
setlocal EnableExtensions
2025-08-08 13:33:08 -06:00
2025-11-08 02:36:20 -07:00
set " script_dir= %~dp0 "
2025-12-15 10:54:09 -07:00
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 "
)
2025-11-08 02:36:20 -07:00
2025-11-10 11:00:12 -07:00
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%
2025-12-15 10:54:09 -07:00
if defined project_config (
echo Also checked: %project_config%
)
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
)
2025-12-15 10:54:09 -07:00
set " GET_STRUCT_DIR= %CONFIG_DIR% \GetStructDir.ps1 "
2025-11-10 11:00:12 -07:00
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 ^
2025-11-10 11:00:12 -07:00
" 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 "
2025-11-08 02:36:20 -07:00
if not defined ps1 (
echo [ERROR] Unable to resolve UpdateSequences.ps1 path from config.
exit /b 1
)
2025-08-18 19:31:09 -06:00
echo Running PowerShell update script...
powershell -NoProfile -ExecutionPolicy Bypass -File " %ps1% "
set " rc= %errorlevel% "
echo PowerShell exited with RC=%rc%
2025-08-19 12:08:03 -06:00
echo Done.
2025-08-26 15:55:21 -06:00
pause > nul
2025-08-26 16:30:45 -06:00
exit /b %rc%