Program.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.IO;
  3. using System.Linq;
  4. namespace Ryujinx.BuildValidationTasks
  5. {
  6. public class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. // Display the number of command line arguments.
  11. if (args.Length == 0)
  12. throw new ArgumentException("Error: too few arguments!");
  13. string path = args[0];
  14. if (string.IsNullOrEmpty(path))
  15. throw new ArgumentException("Error: path is null or empty!");
  16. if (!Path.Exists(path))
  17. throw new FileLoadException($"path {{{path}}} does not exist!");
  18. path = Path.GetFullPath(path);
  19. if (!Directory.GetDirectories(path).Contains($"{path}src"))
  20. throw new FileLoadException($"path {{{path}}} is not a valid ryujinx project!");
  21. bool isGitRunner = path.Contains("runner") || path.Contains("D:\\a\\Ryujinx\\Ryujinx");
  22. if (isGitRunner)
  23. Console.WriteLine("Is Git Runner!");
  24. // Run tasks
  25. // Pass extra info needed in the task constructors
  26. new LocalesValidationTask().Execute(path, isGitRunner);
  27. }
  28. }
  29. }