Skip to content

Commit

Permalink
Allow initialise to stay
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerfulBacon committed Aug 22, 2024
1 parent a1710f7 commit 6eeb04c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tools/SnakeCaseUpdate/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ static void UpdateFile(string filePath, string oldName, string newName)
return;
Console.WriteLine($"Updated {oldName} to {newName} in {filePath}");

//File.WriteAllText(filePath, updated);
File.WriteAllText(filePath, updated);
}

string basePath = "../../../../../code";
Expand All @@ -36,6 +36,10 @@ static void UpdateFile(string filePath, string oldName, string newName)
{
var funcName = match.Groups[1].Value;

// Fine... you get the right to live
if (funcName == "Initialize")
continue;

if (!string.IsNullOrEmpty(funcName) && funcName.Length >= minFunctionNameLength)
{
string snakeCaseName = ToSnakeCase(funcName);
Expand All @@ -44,14 +48,9 @@ static void UpdateFile(string filePath, string oldName, string newName)
Console.WriteLine($"Updating function {funcName} to {snakeCaseName} in {file}");
Console.ResetColor();

// Update function name in the definition
UpdateFile(file, funcName, snakeCaseName);

// Update function references in the entire codebase
foreach (var refFile in files)
{
if (refFile == file) continue; // Skip the file being updated

UpdateFile(refFile, funcName, snakeCaseName);
}
}
Expand Down

0 comments on commit 6eeb04c

Please sign in to comment.