diff --git a/Config.cs b/Config.cs index a8b74a6..fd092d4 100644 --- a/Config.cs +++ b/Config.cs @@ -1,3 +1,4 @@ +// I hereby waive this project under the public domain - see UNLICENSE for details. namespace PublishTimes; /// diff --git a/Program.cs b/Program.cs index 6b8f68b..f5a858b 100644 --- a/Program.cs +++ b/Program.cs @@ -127,15 +127,15 @@ string NewTopic(List topics) void ExportSchedule(List storeSchedule) { // App directory is used for config file - var appDir = Directory.GetCurrentDirectory(); + var appDir = AppDomain.CurrentDomain.BaseDirectory; // File directory is used for file location set in config - var fileDir = Directory.GetCurrentDirectory(); - var communities = new[] { "Games", "Politics", "Research", "Technology" }; - var scheduleFile = "schedule.txt"; + var outputDir = Directory.GetCurrentDirectory(); + var defaultTopics = new[] { "Games", "Politics", "Research", "Technology" }; + var outputFile = "schedule.txt"; var cfgFile = "config.toml"; var cfgPath = Path.Combine(appDir, cfgFile); - var filePath = Path.Combine(fileDir, scheduleFile); + var filePath = Path.Combine(outputDir, outputFile); var appendSchedule = false; var topic = ""; @@ -150,19 +150,19 @@ void ExportSchedule(List storeSchedule) var usrList = tomlList.Split(','); if (!string.IsNullOrEmpty(usrDir)) - fileDir = usrDir; + outputDir = usrDir; if (!string.IsNullOrEmpty(usrFileName)) - scheduleFile = usrFileName; + outputFile = usrFileName; if (usrList.Length > 0) - communities = usrList; + defaultTopics = usrList; // Set new file Path - filePath = Path.Combine(fileDir, scheduleFile); + filePath = Path.Combine(outputDir, outputFile); } - topic = NewTopic(communities.ToList()); + topic = NewTopic(defaultTopics.ToList()); // If the file already exists, assume a previous schedule was written if (File.Exists(filePath)) diff --git a/config.toml.sample b/config.toml.sample index 73b1872..6bdc33d 100644 --- a/config.toml.sample +++ b/config.toml.sample @@ -1,3 +1,8 @@ path = "/home/tonytins/Documents/" file = "newscycle.txt" -topics = [ "Games", "Technology", "Cybersecurity" ] +topics = [ + "Games", + "News", + "Science", + "Programming" +]