Skip to content

Commit

Permalink
validate that line endings are LF on build
Browse files Browse the repository at this point in the history
if running on git it will now fail if the file contains CRLF line endings and tell the user to run a local build to fix it.
  • Loading branch information
LotP1 committed Dec 28, 2024
1 parent 43f6e4a commit 4e56b14
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/Ryujinx.BuildValidationTasks/LocalesValidationTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public static bool Execute(string projectPath)
bool isGitRunner = path.Contains("runner") || path.Contains("D:\\a\\Ryujinx\\Ryujinx");
if (isGitRunner)
Console.WriteLine("Is Git Runner!");

if (isGitRunner && data.Contains("\r\n"))
throw new FormatException("locales.json is using CRLF line endings! It should be using LF line endings, build locally to fix...");

bool encounteredIssue = false;

for (int i = 0; i < json.Locales.Count; i++)
Expand Down
2 changes: 1 addition & 1 deletion src/Ryujinx/Assets/locales.json
Original file line number Diff line number Diff line change
Expand Up @@ -22598,4 +22598,4 @@
}
}
]
}
}

0 comments on commit 4e56b14

Please sign in to comment.