]> fortfriendship.online Git - gnargle.github.io.git/blobdiff - RSSGen/Program.cs
test open graph preview carding
[gnargle.github.io.git] / RSSGen / Program.cs
index 7204f0687155c1b7578de26341e9585683e68f30..b6c16b016d37622515e7be67bd2e3ae0347e3e7c 100644 (file)
@@ -2,11 +2,22 @@
 using System;
 using System.Collections.Generic;
 using System.IO;
 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");
 
 
 // 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<FileInfo>();
 
 if (filePaths.Any())
 var fileInfos = new List<FileInfo>();
 
 if (filePaths.Any())
@@ -22,7 +33,16 @@ if (filePaths.Any())
 
 Console.WriteLine("Scanning projects folder for latest files");
 
 
 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())
 {
 
 if (filePaths.Any())
 {
@@ -49,7 +69,7 @@ myRSS.channel = new rssChannel
     link1 = new link
     {
         href = "https://athene.gay/feed.xml",
     link1 = new link
     {
         href = "https://athene.gay/feed.xml",
-        rel="self",
+        rel = "self",
         type = "application/rss+xml",
     }
 };
         type = "application/rss+xml",
     }
 };
@@ -79,7 +99,16 @@ foreach (var file in fileInfos)
 
 var output = Generator.SerializeRSS(myRSS);
 
 
 var output = Generator.SerializeRSS(myRSS);
 
-var rssPath = Path.Combine(Directory.GetCurrentDirectory(), "../../../../feed.xml");
+var rssPath = String.Empty;
+
+if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+{
+    rssPath = Path.Combine(Directory.GetCurrentDirectory(), "../feed.xml");
+}
+else
+{
+    rssPath = Path.Combine(Directory.GetCurrentDirectory(), "../../../../feed.xml");
+}
 
 if (File.Exists(rssPath))
 {
 
 if (File.Exists(rssPath))
 {