]> fortfriendship.online Git - gnargle.github.io.git/commitdiff
modify rssgen for linux compatibility
authorAthene Allen <atheneallen93@gmail.com>
Sat, 1 Feb 2025 10:39:54 +0000 (10:39 +0000)
committerAthene Allen <atheneallen93@gmail.com>
Sat, 1 Feb 2025 10:39:54 +0000 (10:39 +0000)
.vscode/launch.json [new file with mode: 0644]
.vscode/tasks.json [new file with mode: 0644]
RSSGen/Program.cs

diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644 (file)
index 0000000..3d85777
--- /dev/null
@@ -0,0 +1,26 @@
+{
+    "version": "0.2.0",
+    "configurations": [
+        {
+            // Use IntelliSense to find out which attributes exist for C# debugging
+            // Use hover for the description of the existing attributes
+            // For further information visit https://github.com/dotnet/vscode-csharp/blob/main/debugger-launchjson.md
+            "name": ".NET Core Launch (console)",
+            "type": "coreclr",
+            "request": "launch",
+            "preLaunchTask": "build",
+            // If you have changed target frameworks, make sure to update the program path.
+            "program": "${workspaceFolder}/RSSGen/bin/Debug/net8.0/RSSGen.dll",
+            "args": [],
+            "cwd": "${workspaceFolder}/RSSGen",
+            // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
+            "console": "internalConsole",
+            "stopAtEntry": false
+        },
+        {
+            "name": ".NET Core Attach",
+            "type": "coreclr",
+            "request": "attach"
+        }
+    ]
+}
\ No newline at end of file
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644 (file)
index 0000000..2bcce95
--- /dev/null
@@ -0,0 +1,41 @@
+{
+    "version": "2.0.0",
+    "tasks": [
+        {
+            "label": "build",
+            "command": "dotnet",
+            "type": "process",
+            "args": [
+                "build",
+                "${workspaceFolder}/RSSGen/RSSGen.sln",
+                "/property:GenerateFullPaths=true",
+                "/consoleloggerparameters:NoSummary;ForceNoAlign"
+            ],
+            "problemMatcher": "$msCompile"
+        },
+        {
+            "label": "publish",
+            "command": "dotnet",
+            "type": "process",
+            "args": [
+                "publish",
+                "${workspaceFolder}/RSSGen/RSSGen.sln",
+                "/property:GenerateFullPaths=true",
+                "/consoleloggerparameters:NoSummary;ForceNoAlign"
+            ],
+            "problemMatcher": "$msCompile"
+        },
+        {
+            "label": "watch",
+            "command": "dotnet",
+            "type": "process",
+            "args": [
+                "watch",
+                "run",
+                "--project",
+                "${workspaceFolder}/RSSGen/RSSGen.sln"
+            ],
+            "problemMatcher": "$msCompile"
+        }
+    ]
+}
\ No newline at end of file
index 7204f0687155c1b7578de26341e9585683e68f30..19f6832f2b59a8b5a476f019cba08abda86e8afa 100644 (file)
@@ -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<FileInfo>();
 
 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",
     }
 };