mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Updated ModPreprocessorDefine.csx
This commit is contained in:
parent
8ee132b4af
commit
0a53a72e84
12
.github/ModPreprocessorDefine.csx
vendored
12
.github/ModPreprocessorDefine.csx
vendored
@ -7,7 +7,7 @@ using System.Text.RegularExpressions;
|
|||||||
|
|
||||||
void Main()
|
void Main()
|
||||||
{
|
{
|
||||||
Console.WriteLine("ModPreprocessorDefine Started);
|
Console.WriteLine("ModPreprocessorDefine Started");
|
||||||
|
|
||||||
// Redirect console output to a file
|
// Redirect console output to a file
|
||||||
var originalConsoleOut = Console.Out;
|
var originalConsoleOut = Console.Out;
|
||||||
@ -21,19 +21,19 @@ void Main()
|
|||||||
|
|
||||||
// Read the contents of the file
|
// Read the contents of the file
|
||||||
string fileContents = File.ReadAllText(filePath);
|
string fileContents = File.ReadAllText(filePath);
|
||||||
Console.WriteLine("ModPreprocessorDefine File read);
|
Console.WriteLine("ModPreprocessorDefine File read");
|
||||||
|
|
||||||
// Find and remove the first entry ending with "_OR_NEWER"
|
// Find and remove the first entry ending with "_OR_NEWER"
|
||||||
fileContents = RemoveFirstOrNewerEntry(fileContents);
|
fileContents = RemoveFirstOrNewerEntry(fileContents);
|
||||||
Console.WriteLine("ModPreprocessorDefine Old entry removed);
|
Console.WriteLine("ModPreprocessorDefine Old entry removed");
|
||||||
|
|
||||||
// Find the last entry and capture the version number
|
// Find the last entry and capture the version number
|
||||||
string versionNumber = GetLastVersionNumber(fileContents);
|
string versionNumber = GetLastVersionNumber(fileContents);
|
||||||
Console.WriteLine($"ModPreprocessorDefine current version {versionNumber});
|
Console.WriteLine($"ModPreprocessorDefine current version {versionNumber}");
|
||||||
|
|
||||||
// Append a new entry with the correct indentation and next version number
|
// Append a new entry with the correct indentation and next version number
|
||||||
fileContents = AppendNewEntry(fileContents, versionNumber);
|
fileContents = AppendNewEntry(fileContents, versionNumber);
|
||||||
Console.WriteLine("ModPreprocessorDefine New entry appended);
|
Console.WriteLine("ModPreprocessorDefine New entry appended");
|
||||||
|
|
||||||
// Write the modified contents back to the file
|
// Write the modified contents back to the file
|
||||||
File.WriteAllText(filePath, fileContents);
|
File.WriteAllText(filePath, fileContents);
|
||||||
@ -41,7 +41,7 @@ void Main()
|
|||||||
Console.SetOut(originalConsoleOut);
|
Console.SetOut(originalConsoleOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.WriteLine("ModPreprocessorDefine Finished);
|
Console.WriteLine("ModPreprocessorDefine Finished");
|
||||||
|
|
||||||
// Print the contents of the redirected file
|
// Print the contents of the redirected file
|
||||||
Console.WriteLine("Console Output:");
|
Console.WriteLine("Console Output:");
|
||||||
|
Loading…
Reference in New Issue
Block a user