Skip to content

Commit af3eb7e

Browse files
committed
Permeated changelog parser fixes to updater
1 parent efa3d92 commit af3eb7e

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

b-e updater.bat

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,17 @@ if /i "%1"=="--silent" (
7171
set "UpdateVersion=v%ver:~1%"
7272

7373
>%TEMP%\batch_update.tmp findstr "body" %updateFileName%
74-
<%TEMP%\batch_update.tmp set /p "entry_body="
75-
set "changelog=%entry_body:~11,-1%"
74+
set "pwsh_replace=-replace '^!' -replace '^<\/\S*?^>', '#[FORMEND]#' -replace '^<\S*?^>', '#[FORM]#' -replace '^<', '(less)' -replace '^>', '(more)'"
75+
for /F "tokens=*" %%g in ('powershell -Command "(Get-Content $env:TEMP\batch_update.tmp) !pwsh_replace! "') do (set entry_body=%%g)
76+
set "changelog=%entry_body:~9,-1%"
77+
set "changelog=%changelog:#[FORM]#=%"
78+
set "changelog=%changelog:#[FORMEND]#=!formatend!%"
7679
set "changelog=%changelog:\n#=\n\r\n#%"
7780
set "changelog=%changelog:#=#%"
7881
set "changelog=%changelog:\r=!formatend!\r%"
7982
set "changelog=%changelog: `= %"
8083
set "changelog=%changelog:` =!formatend! %"
84+
8185
>%TEMP%\batch_update.tmp echo %changelog%
8286
for %%? in (%TEMP%\batch_update.tmp) do (set /A strlength=%%~z? - 2)
8387
if %strlength% gtr 1000 (set "changelog=%changelog:~0,1000%... %textgray%[More]%formatend%")
@@ -116,9 +120,9 @@ if /i "%1"=="--silent" (
116120
echo.
117121

118122
if "%par_silent%"=="true" (
119-
echo The program will now clean up and exit.
123+
echo %icongray% i %formatend% The program will now clean up and exit.
120124
) else (
121-
echo The program will now clean up and restart.
125+
echo %icongray% i %formatend% The program will now clean up and restart.
122126
)
123127

124128
call:GrayPause

0 commit comments

Comments
 (0)