|
1 | 1 | @echo off |
2 | 2 | setlocal enabledelayedexpansion |
3 | 3 |
|
4 | | -set CurrentVersion=v1.7.0 |
| 4 | +set CurrentVersion=v1.7.1 |
5 | 5 | cls |
6 | 6 |
|
7 | 7 | set "icongray=[7;90m" |
@@ -125,13 +125,17 @@ if defined par_updated-from ( |
125 | 125 | set "UpdateVersion=v%ver:~1%" |
126 | 126 |
|
127 | 127 | >%TEMP%\batch_update.tmp findstr "body" %updateFileName% |
128 | | - <%TEMP%\batch_update.tmp set /p "entry_body=" |
129 | | - set "changelog=%entry_body:~11,-1%" |
| 128 | + set "pwsh_replace=-replace '^!' -replace '^<\/\S*?^>', '#[FORMEND]#' -replace '^<\S*?^>', '#[FORM]#' -replace '^<', '(less)' -replace '^>', '(more)'" |
| 129 | + for /F "tokens=*" %%g in ('powershell -Command "(Get-Content $env:TEMP\batch_update.tmp) !pwsh_replace! "') do (set entry_body=%%g) |
| 130 | + set "changelog=%entry_body:~9,-1%" |
| 131 | + set "changelog=%changelog:#[FORM]#=[1m%" |
| 132 | + set "changelog=%changelog:#[FORMEND]#=!formatend!%" |
130 | 133 | set "changelog=%changelog:\n#=\n\r\n#%" |
131 | 134 | set "changelog=%changelog:#=[100;37m#%" |
132 | 135 | set "changelog=%changelog:\r=!formatend!\r%" |
133 | 136 | set "changelog=%changelog: `= [1m%" |
134 | 137 | set "changelog=%changelog:` =!formatend! %" |
| 138 | + |
135 | 139 | >%TEMP%\batch_update.tmp echo %changelog% |
136 | 140 | for %%? in (%TEMP%\batch_update.tmp) do (set /A strlength=%%~z? - 2) |
137 | 141 | if %strlength% gtr 1000 (set "changelog=%changelog:~0,1000%... %textgray%[More]%formatend%") |
@@ -167,6 +171,7 @@ if defined par_updated-from ( |
167 | 171 | echo %iconyellow% ^^! %formatend% Differing version found^^! ^(%textred%%CurrentVersion%%formatend% -^> %textgreen%%UpdateVersion%%formatend%^) |
168 | 172 | echo Proceeding with update in 5 seconds; close window to cancel. |
169 | 173 | ) |
| 174 | + :: ... anim |
170 | 175 | echo. & echo [s |
171 | 176 | for /l %%x in (1, 1, 6) do ( |
172 | 177 | timeout /nobreak /t 1 > nul |
|
0 commit comments