This commit is contained in:
2026-09-11 14:21:54 +03:00
parent 7eb0472bb6
commit 695fca0d84
3 changed files with 60 additions and 11 deletions

View File

@@ -3,6 +3,7 @@ setlocal EnableExtensions EnableDelayedExpansion
chcp 65001 > nul
rem Същите ключове като GET /healthz: ok, version, git.
rem Префиксът е от VERSION; SHA е от git (не може да е в commit-натия файл).
rem Двоен клик / без аргументи — pause. От терминал: show-version.bat -q
set "ROOT=%~dp0"
if "%ROOT:~-1%"=="\" set "ROOT=%ROOT:~0,-1%"
@@ -14,11 +15,18 @@ if exist "%ROOT%\VERSION" (
)
set "GIT_SHA=dev"
for /f "usebackq delims=" %%I in (`git rev-parse --short=7 HEAD 2^>nul`) do set "GIT_SHA=%%I"
set "SHA_FILE=%TEMP%\rip-help-git-sha.txt"
git rev-parse --short=7 HEAD > "%SHA_FILE%" 2>nul
if exist "%SHA_FILE%" (
set /p GIT_SHA=<"%SHA_FILE%"
del "%SHA_FILE%" >nul 2>&1
)
if not defined GIT_SHA set "GIT_SHA=dev"
if "!GIT_SHA!"=="" set "GIT_SHA=dev"
echo {"ok": true, "version": "%APP_VERSION%+!GIT_SHA!", "git": "!GIT_SHA!"}
echo.
echo Сравни "git" с https://rip.inex-project.net/healthz
echo Production вижда SHA едва след commit + push + Coolify redeploy.
echo.
pause
if /i not "%~1"=="-q" pause