-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.cs
36 lines (30 loc) · 1.34 KB
/
Main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
namespace PruebaDepuraciónDiscord
{
static class Program
{
private static void Main(string[] args)
{
Console.OutputEncoding = System.Text.Encoding.UTF8;
Console.InputEncoding = System.Text.Encoding.UTF8;
// Check if an argument was passed to delete download files
if (args.Length > 0 && args[0] == "deleteDownloads")
{
string DownloadDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads");
string DownloadlogFilePath = Directory.GetCurrentDirectory() + "\\RemoveLogs.log";
Console.WriteLine($"Using Downloads directory: {DownloadDirectory}");
Utils.EnsureLogFileExists(DownloadlogFilePath);
Utils.CleanLogFiles(DownloadDirectory, DownloadlogFilePath);
return;
}
string directoryPath = Utils.GetDirectoryPathFromUser();
if (!Directory.Exists(directoryPath))
{
Console.WriteLine("The specified directory does not exist.");
return;
}
string logFilePath = Directory.GetCurrentDirectory() + "\\RemoveLogs.log";
Utils.EnsureLogFileExists(logFilePath);
Utils.CleanLogFiles(directoryPath, logFilePath);
}
}
}