Skip to content

Commit

Permalink
update script
Browse files Browse the repository at this point in the history
- not so verbose
- aborts if needed executables are not found
- aborts if needed repositories are not cloned in parent dir
  • Loading branch information
israpps committed Apr 8, 2024
1 parent 4ce5476 commit 6a29743
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ FINAL.TXT
LST.TXT
LST2.TXT
gamename.csv
busybox.exe
PS2_pnach_converter.exe
37 changes: 30 additions & 7 deletions update.bat
Original file line number Diff line number Diff line change
@@ -1,20 +1,44 @@
@echo off
title automated archive updater

where busybox.exe >nul 2>nul
if errorlevel 1 (
echo ERROR: busybox.exe not found
goto QUIT
)

where PS2_pnach_converter.exe >nul 2>nul
if errorlevel 1 (
echo ERROR: PS2_pnach_converter.exe not found
goto QUIT
)

if not exist ..\Bare-Mastercodes-bin\.git (
echo Bare mastercodes bin archive is missing on parent dir! clone it there before running
goto QUIT
)

if not exist ..\pcsx2_patches\.git (
echo PCSX2 Cheats archive is missing on parent dir! clone it there before running
goto QUIT
)


for %%a in (%*) do (
if "%%a"=="--clean" (
echo cleaning cache
del LST.TXT
del LST2.TXT
del FINAL.TXT
del MISSING_MASTERCODE.TSV
del LST.TXT 2>nul
del LST2.TXT 2>nul
del FINAL.TXT 2>nul
del MISSING_MASTERCODE.TSV 2>nul
)
)

if not exist LST.TXT (
echo # listing widescreen hacks from pcsx2_patches...
findstr /I /M "Widescreen" ..\pcsx2_patches\patches\*.*>LST.TXT
)

REM busybox.exe grep -Eo "[a-zA-Z]{4}-[0-9]{5}.*.pnach" LST.TXT | busybox.exe grep -Eo "[a-zA-Z]{4}-[0-9]{5}" > LST2.TXT
if not exist LST2.TXT (
echo ## Temporal list of game ID not found, constructing. this will take a while...
Expand All @@ -36,7 +60,6 @@ for /f "delims=; tokens=1,*" %%a in (LST2.TXT) do (
echo %%a;%%b >>FINAL.TXT
set /a CNT += 1
) else (
echo %%a
if not exist CHT\%%a.cht (
set /a CNT2 += 1
echo %%a https://github.com/PCSX2/pcsx2_patches/blob/main/patches/%%b>>MISSING_MASTERCODE.TSV
Expand All @@ -47,7 +70,6 @@ for /f "delims=; tokens=1,*" %%a in (LST2.TXT) do (

for /f "delims=; tokens=1,*" %%a in (FINAL.TXT) do (
if exist ..\pcsx2_patches\patches\%%b (
echo %%a
copy ..\Bare-Mastercodes-bin\MASTERCODES\%%a.cht CHT\%%a.cht>nul
PS2_pnach_converter.exe ..\pcsx2_patches\patches\%%b -g -l >>CHT\%%a.cht
) else echo HUSTON, WE HAVE A PROBLEM %%a @ %%b
Expand All @@ -62,4 +84,5 @@ if errorlevel 0 (
)

REM del LST.TXT
REM del LST2.TXT
REM del LST2.TXT
:QUIT

0 comments on commit 6a29743

Please sign in to comment.