X-Git-Url: https://fortfriendship.online/gitweb/gnargle.github.io.git/blobdiff_plain/1a7eea4f546ec5ead24aa31d7bf884ca482287c1..d7a192ed0520e86077032d5b9d814077c542da4c:/RSSGen/Program.cs?ds=inline diff --git a/RSSGen/Program.cs b/RSSGen/Program.cs index 7204f06..19f6832 100644 --- a/RSSGen/Program.cs +++ b/RSSGen/Program.cs @@ -2,11 +2,22 @@ using System; using System.Collections.Generic; using System.IO; +using System.Runtime.InteropServices; // See https://aka.ms/new-console-template for more information Console.WriteLine("Scanning entries folder for latest files"); -var filePaths = Directory.EnumerateFiles(Path.Combine(Directory.GetCurrentDirectory(), "../../../../entries")); +var folder = String.Empty; + +if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) +{ + folder = Path.Combine(Directory.GetCurrentDirectory(), "../entries"); +} +else +{ + folder = Path.Combine(Directory.GetCurrentDirectory(), "../../../../entries"); +} +var filePaths = Directory.EnumerateFiles(folder); var fileInfos = new List(); if (filePaths.Any()) @@ -22,7 +33,16 @@ if (filePaths.Any()) Console.WriteLine("Scanning projects folder for latest files"); -filePaths = Directory.EnumerateFiles(Path.Combine(Directory.GetCurrentDirectory(), "../../../../projects")); +if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) +{ + folder = Path.Combine(Directory.GetCurrentDirectory(), "../projects"); +} +else +{ + folder = Path.Combine(Directory.GetCurrentDirectory(), "../../../../projects"); +} + +filePaths = Directory.EnumerateFiles(folder); if (filePaths.Any()) { @@ -49,7 +69,7 @@ myRSS.channel = new rssChannel link1 = new link { href = "https://athene.gay/feed.xml", - rel="self", + rel = "self", type = "application/rss+xml", } };