From 8a4cb05d02ca799f8a3498cb7bdbf9a19ad68869 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Mar 2026 18:05:26 +0000 Subject: [PATCH] Inline single-use DirPath variables and move CreateDirectory calls next to their write sites Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> Agent-Logs-Url: https://github.com/Tyrrrz/DiscordChatExporter/sessions/73520af9-6314-464f-ae0f-1bb63f1d1105 --- DiscordChatExporter.Gui/Publish-MacOSBundle.csx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/DiscordChatExporter.Gui/Publish-MacOSBundle.csx b/DiscordChatExporter.Gui/Publish-MacOSBundle.csx index fb40a41a..c73fb2a1 100644 --- a/DiscordChatExporter.Gui/Publish-MacOSBundle.csx +++ b/DiscordChatExporter.Gui/Publish-MacOSBundle.csx @@ -35,17 +35,16 @@ public class PublishMacOSBundleCommand : ICommand var bundleName = "DiscordChatExporter.app"; var bundleDirPath = Path.Combine(tempDirPath, bundleName); var contentsDirPath = Path.Combine(bundleDirPath, "Contents"); - var macosDirPath = Path.Combine(contentsDirPath, "MacOS"); - var resourcesDirPath = Path.Combine(contentsDirPath, "Resources"); try { - // Initialize the bundle's directory structure - Directory.CreateDirectory(macosDirPath); - Directory.CreateDirectory(resourcesDirPath); - // Copy icons into the .app's Resources folder - File.Copy(IconsFilePath, Path.Combine(resourcesDirPath, "AppIcon.icns"), true); + Directory.CreateDirectory(Path.Combine(contentsDirPath, "Resources")); + File.Copy( + IconsFilePath, + Path.Combine(contentsDirPath, "Resources", "AppIcon.icns"), + true + ); // Generate the Info.plist metadata file with the app information // lang=xml @@ -90,9 +89,10 @@ public class PublishMacOSBundleCommand : ICommand Directory.Delete(existingBundlePath, true); // Move all files from the publish directory into the MacOS directory + Directory.CreateDirectory(Path.Combine(contentsDirPath, "MacOS")); foreach (var entry in Directory.GetFileSystemEntries(publishDirPath)) { - var destination = Path.Combine(macosDirPath, Path.GetFileName(entry)); + var destination = Path.Combine(contentsDirPath, "MacOS", Path.GetFileName(entry)); if (Directory.Exists(entry)) Directory.Move(entry, destination); else