Skip to content

Commit

Permalink
- F Created approve_all.bat
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottBob committed Jan 9, 2025
1 parent 6b446dd commit 0ecf28d
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions resources/approve_all.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@echo off

FOR /F "usebackq delims=" %%L IN ("..\approvaltests-tests\.approval_tests_temp\.failed_comparison.log") DO (
REM Store the entire line in an environment variable named LINE
SET "LINE=%%L"
REM Call a subroutine to parse and handle the line
CALL :ProcessLine
)

GOTO :EOF

:ProcessLine
REM Enable delayed expansion so we can safely manipulate LINE
SETLOCAL ENABLEDELAYEDEXPANSION

REM Replace " -> " with a pipe character so we can split easily
SET "LINE=!LINE: -> =|!"

REM Now split the line on the pipe and capture each side
FOR /F "tokens=1,2 delims=|" %%A IN ("!LINE!") DO (
ECHO Moving "%%~A" to "%%~B"
MOVE "%%~A" "%%~B"
)

ENDLOCAL
GOTO :EOF

0 comments on commit 0ecf28d

Please sign in to comment.