attempt to clean up working directories
This commit is contained in:
parent
983a57b3d7
commit
54d2afac8d
19
Program.cs
19
Program.cs
@ -179,6 +179,25 @@ namespace ttrss_co_client
|
||||
await ttrssClient.Logout();
|
||||
Console.WriteLine($"logged out of ttrss.");
|
||||
|
||||
#region cleanup
|
||||
Console.WriteLine("===== phase 3 =====");
|
||||
//loop through working directory looking for other work orders to add
|
||||
var subdirs = Directory.GetDirectories(conf.WorkingDirectory);
|
||||
foreach(var subdir in subdirs)
|
||||
{
|
||||
if(Directory.GetFiles(subdir)?.Length == 0)
|
||||
{
|
||||
Console.WriteLine($"{subdir} is empty");
|
||||
Directory.Delete(subdir);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"{subdir} is not empty: {string.Join(", ", Directory.GetFiles(subdir))}");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Console.WriteLine($"done for real");
|
||||
}
|
||||
static Configuration Configure(string configurationPath = "appsettings.json")
|
||||
|
@ -17,7 +17,7 @@ public class ChatMessage : Phase2Task
|
||||
await Process.Start(ChatScript,
|
||||
workOrder.data["chatmessage"] +
|
||||
(await TtrssClient.GetArticles(workOrder.articleId)).First().feed_title +
|
||||
"; " +
|
||||
": " +
|
||||
(await TtrssClient.GetArticles(workOrder.articleId)).First().title
|
||||
).WaitForExitAsync();
|
||||
return new Tuple<TaskStatus, WorkOrder>(TaskStatus.Done, workOrder);
|
||||
|
Loading…
Reference in New Issue
Block a user