strip CR from gamehelp files during build

This commit is contained in:
Peter Ferrie 2020-04-02 17:10:33 -07:00
parent 7402d19f89
commit a8fef1579b
2 changed files with 18 additions and 0 deletions

17
bin/dumpcr.js Normal file
View File

@ -0,0 +1,17 @@
a = new ActiveXObject("scripting.filesystemobject")
b = WScript.Arguments(0).lastIndexOf('\\') + 1
c = WScript.Arguments(0).substr(0, b)
d = WScript.Arguments(0).substr(b)
if (d.substr(0, 2) == '*.')
{
d = d.substr(2)
}
for (b = new Enumerator(a.GetFolder(c).files); !b.atEnd(); b.moveNext())
{
if ((d == '*') || (d == a.getextensionname(b.item().name)))
{
e = a.opentextfile(c + b.item().name).readall()
e = e.replace(/\r\n/g, "\n")
a.createtextfile(c + b.item().name).write(e)
}
}

View File

@ -80,6 +80,7 @@ for %%q in (res\dsk\*.po) do %CADIUS% EXTRACTVOLUME "%%q" build\X\ >>build\log
cscript /nologo bin\rsync.js "res\GAMEHELP\*" "build\GAMEHELP" >>build\log
for %%q in (res\title.hgr\*) do if not exist build\GAMEHELP\%%~nxq 1>nul copy build\GAMEHELP\STANDARD build\GAMEHELP\%%~nxq
for %%q in (res\title.dhgr\*) do if not exist build\GAMEHELP\%%~nxq 1>nul copy build\GAMEHELP\STANDARD build\GAMEHELP\%%~nxq
cscript /nologo bin\dumpcr.js "build\GAMEHELP\*"
cscript /nologo bin\buildfileinfo.js build\GAMEHELP "06" "6000" >>build\log
%CADIUS% ADDFOLDER "build\%DISK%" "/%VOLUME%/GAMEHELP" "build\GAMEHELP" >>build\log
cscript /nologo bin\changebootloader.js "build\%DISK%" res\proboothd