Skip to content

Commit

Permalink
Fixes some more script issues
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerfulBacon committed Aug 22, 2024
1 parent d99cd61 commit 8ac3ffd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/SnakeCaseUpdate/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ static string ToSnakeCase(string name)
static bool UpdateFile(string filePath, string oldName, string newName)
{
var text = File.ReadAllText(filePath);
var updated = Regex.Replace(text, $@"\b{Regex.Escape(oldName)}\(", $"{newName}(", RegexOptions.Multiline);
var updated = Regex.Replace(text, $@"[^/]{Regex.Escape(oldName)}\(", $"{newName}(", RegexOptions.Multiline);
updated = Regex.Replace(text, $@"_REF\({Regex.Escape(oldName)}\)", @$"REF\({newName}\)", RegexOptions.Multiline);
if (updated == text)
return false;
File.WriteAllText(filePath, updated);
Expand Down Expand Up @@ -43,8 +44,11 @@ static bool UpdateFile(string filePath, string oldName, string newName)
var funcName = match.Groups[1].Value;

// Fine... you get the right to live
if (funcName == "Initialize" || funcName == "Destroy" || funcName == "Entered" || funcName == "Exited" || funcName == "Animate")
if (funcName == "Initialize" || funcName == "Destroy" || funcName == "Entered" || funcName == "Exited" || funcName == "Animate" || funcName == "Replace" || funcName == "Execute")
{
skippedFunctionNames.Add(funcName);
continue;
}

if (!string.IsNullOrEmpty(funcName) && funcName.Length >= minFunctionNameLength)
{
Expand Down

0 comments on commit 8ac3ffd

Please sign in to comment.