test: add file list

This commit is contained in:
Sören Weber 2023-06-08 17:59:03 +02:00
parent aaa25e1322
commit 2f010f3944
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 32 additions and 10 deletions

View file

@ -1,11 +1,22 @@
@echo off @echo off
set /p version=<..\layouts\partials\version.txt setlocal enabledelayedexpansion
echo %version%>metrics.%version%.txt set /p version=<..\layouts\partials\version.log
echo %version%>metrics.%version%.log
echo disableAssetsBusting=true>>config.toml echo disableAssetsBusting=true>>config.toml
echo disableGeneratorVersion=true>>config.toml echo disableGeneratorVersion=true>>config.toml
echo disableRandomIds=true>>config.toml echo disableRandomIds=true>>config.toml
hugo --templateMetrics --templateMetricsHints --cleanDestinationDir --destination public.%version% >> metrics.%version%.txt hugo --templateMetrics --templateMetricsHints --cleanDestinationDir --destination public.%version% >> metrics.%version%.log
move /Y metrics.%version%.txt public.%version%\metrics.txt 2>&1 >NUL
set "start_dir=%CD%\public.%version%"
set "output_file=dir.%version%.log"
if exist "%output_file%" del "%output_file%"
for /r "%start_dir%" %%F in (*) do (
set "file=%%F"
echo !file:%start_dir%\=! >> "%output_file%"
)
move /Y dir.%version%.log public.%version%\dir.log 2>&1 >NUL
move /Y metrics.%version%.log public.%version%\metrics.log 2>&1 >NUL
git restore config.toml git restore config.toml
For /F "UseBackQ Delims==" %%A In ("public.%version%\metrics.txt") Do Set "lastline=%%A" For /F "UseBackQ Delims==" %%A In ("public.%version%\metrics.log") Do Set "lastline=%%A"
echo %lastline% echo %lastline%

View file

@ -1,13 +1,24 @@
@echo off @echo off
setlocal enabledelayedexpansion
set hugo_major=0 set hugo_major=0
set hugo_minor=95 set hugo_minor=95
set hugo_patch=0 set hugo_patch=0
set /p version=<..\layouts\partials\version.txt set /p version=<..\layouts\partials\version.log
echo %version%>metrics.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.txt echo %version%>metrics.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.log
echo disableAssetsBusting=true>>config.toml echo disableAssetsBusting=true>>config.toml
echo disableGeneratorVersion=true>>config.toml echo disableGeneratorVersion=true>>config.toml
hugo.%hugo_major%.%hugo_minor%.%hugo_patch% --templateMetrics --templateMetricsHints --cleanDestinationDir --destination public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch% >> metrics.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.txt hugo.%hugo_major%.%hugo_minor%.%hugo_patch% --templateMetrics --templateMetricsHints --cleanDestinationDir --destination public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch% >> metrics.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.log
move /Y metrics.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.txt public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%\metrics.txt 2>&1 >NUL
set "start_dir=%CD%\public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%"
set "output_file=dir.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.log"
if exist "%output_file%" del "%output_file%"
for /r "%start_dir%" %%F in (*) do (
set "file=%%F"
echo !file:%start_dir%\=! >> "%output_file%"
)
move /Y dir.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.log public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%\dir.log 2>&1 >NUL
move /Y metrics.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.log public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%\metrics.log 2>&1 >NUL
git restore config.toml git restore config.toml
For /F "UseBackQ Delims==" %%A In ("public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%\metrics.txt") Do Set "lastline=%%A" For /F "UseBackQ Delims==" %%A In ("public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%\metrics.log") Do Set "lastline=%%A"
echo %lastline% echo %lastline%