MCPcopy Create free account
hub / github.com/IceClusters/icmysql / Main

Method Main

library/library-changer/Program.cs:27–64  ·  view source on GitHub ↗
(string[] args)

Source from the content-addressed store, hash-verified

25 };
26
27 static void Main(string[] args)
28 {
29 if (args.Length > 0)
30 {
31 ParseResourcesFolder(args[0]);
32 }
33 else
34 {
35 string currentPath = Environment.CurrentDirectory;
36 bool resourceFolderFound = false;
37 try
38 {
39 while (!resourceFolderFound)
40 {
41 string[] directories = Directory.GetDirectories(currentPath);
42 foreach (string directory in directories)
43 {
44 string[] parts = directory.Split(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar);
45 string folderName = parts[parts.Length - 1];
46 if (folderName == "resources")
47 {
48 resourceFolderFound = true;
49 Console.WriteLine("Resource folder found at " + directory);
50 ParseResourcesFolder(directory);
51 break;
52 }
53 }
54 if (!resourceFolderFound)
55 {
56 currentPath = Path.GetDirectoryName(currentPath);
57 }
58 }
59 } catch(Exception err)
60 {
61 Console.WriteLine("Couldn't find resources folder. Please insert the path manually by passing the path as a param to the exe, example: library-changer.exe C:\\FiveM\\Servers\\MyServer\\resources");
62 }
63 }
64 }
65
66 static void ParseResourcesFolder(string path)
67 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected