|
3 | 3 | using System.IO;
|
4 | 4 | using System.Threading;
|
5 | 5 | using ICSharpCode.SharpZipLib.BZip2;
|
| 6 | +using System.Diagnostics; |
6 | 7 |
|
7 | 8 | namespace FastDL_Generator
|
8 | 9 | {
|
9 | 10 | class Program
|
10 | 11 | {
|
11 |
| - |
12 | 12 | public static void Main(string[] args)
|
13 | 13 | {
|
14 |
| - Console.Title = "FastDL Generator"; |
| 14 | + // Program only accepts 1 directory, |
| 15 | + // run it for every additional directory passed |
| 16 | + if (args.Length > 1) |
| 17 | + { |
| 18 | + string currentProgramPath = System.Reflection.Assembly.GetExecutingAssembly().Location; |
| 19 | + |
| 20 | + for (int i = 0; i < args.Length; i++) |
| 21 | + { |
| 22 | + var newProc = new Process(); |
| 23 | + var startInfo = new ProcessStartInfo(); |
| 24 | + startInfo.FileName = currentProgramPath; |
| 25 | + startInfo.Arguments = $"\"{args[i]}\""; |
| 26 | + newProc.StartInfo = startInfo; |
| 27 | + newProc.Start(); |
| 28 | + } |
| 29 | + |
| 30 | + return; |
| 31 | + } |
| 32 | + |
15 | 33 | int RunningTasks = 0;
|
16 | 34 | int MaxTasks = 2;
|
17 | 35 | int HardLimit = 4;
|
@@ -54,13 +72,7 @@ public static void Main(string[] args)
|
54 | 72 | }
|
55 | 73 |
|
56 | 74 | // Same as above but instead quitting just set default path as the target path
|
57 |
| - string copyPath = MainPath + $"/../fastdl-{Path.GetFileName(MainPath)}"; |
58 |
| - try |
59 |
| - { |
60 |
| - if (Directory.Exists(args[1])) |
61 |
| - copyPath = args[1]; |
62 |
| - } |
63 |
| - catch (Exception) { } |
| 75 | + string copyPath = MainPath + $"/../fastdl-{Path.GetFileName(MainPath).ToLower()}"; |
64 | 76 |
|
65 | 77 | // if it exists Clear it because we need a clear folder
|
66 | 78 | if (Directory.Exists(copyPath))
|
@@ -167,7 +179,7 @@ void ThreadedCompressing()
|
167 | 179 | Console.WriteLine("All Threads Killed, Generator closed");
|
168 | 180 |
|
169 | 181 | // Save the fastdl.lua in the target folder
|
170 |
| - File.WriteAllText(copyPath + $"/fastdl-{Path.GetFileName(MainPath)}.lua", FileData); |
| 182 | + File.WriteAllText(copyPath + $"/fastdl-{Path.GetFileName(MainPath).ToLower()}.lua", FileData); |
171 | 183 | }
|
172 | 184 | }
|
173 | 185 |
|
@@ -210,7 +222,6 @@ private static string[] TreeScan(string mainDir, string search)
|
210 | 222 | {
|
211 | 223 | return new string[] { };
|
212 | 224 | }
|
213 |
| - |
214 | 225 | }
|
215 | 226 |
|
216 | 227 | private static bool BzipFile(string Path)
|
|
0 commit comments