Skip to content

Commit

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

0 comments on commit 51c665a

Please sign in to comment.