Merge pull request #139 from Lorenzooone/build_info_branch

Add option to get the build date
This commit is contained in:
jeffman 2021-06-04 18:57:01 -04:00 committed by GitHub
commit 188ac3ae75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace ScriptTool
{
static class PreProcessStrings
{
private static string date_command_str = "\\date";
private static DateTime currentTime = DateTime.UtcNow;
public static string PrepareMainText(string m12Strings)
{
string result = m12Strings.Replace(date_command_str, currentTime.ToString());
return result;
}
}
}

View File

@ -440,6 +440,9 @@ namespace ScriptTool
// Get the strings
string m12Strings = File.ReadAllText(Path.Combine(options.WorkingDirectory, "m12-strings-english.txt"));
// Preprocess the strings
m12Strings = PreProcessStrings.PrepareMainText(m12Strings);
// Compile
m12Compiler.ScanString(m12Strings, ref referenceAddress, ebCharLookup, false);
referenceAddress = baseAddress;

File diff suppressed because one or more lines are too long