From a8fef1579be36614991fc5c139d16aad23b7cbd7 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Thu, 2 Apr 2020 17:10:33 -0700 Subject: [PATCH] strip CR from gamehelp files during build --- bin/dumpcr.js | 17 +++++++++++++++++ winmake.bat | 1 + 2 files changed, 18 insertions(+) create mode 100644 bin/dumpcr.js diff --git a/bin/dumpcr.js b/bin/dumpcr.js new file mode 100644 index 000000000..8afa2b815 --- /dev/null +++ b/bin/dumpcr.js @@ -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) + } +} diff --git a/winmake.bat b/winmake.bat index 372ca6f20..1195ddb25 100644 --- a/winmake.bat +++ b/winmake.bat @@ -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