From c92efc65ce7cbfbca3e92e027141e6b8d90073c8 Mon Sep 17 00:00:00 2001 From: Nuz / Lovegood Date: Sun, 10 Apr 2022 18:20:11 -0700 Subject: Make ModScanner ignore .gitignore files. This is helpful for cases like this: https://cdn.discordapp.com/attachments/156109690059751424/962879339739885578/unknown.png --- src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/SMAPI.Toolkit/Framework') diff --git a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs index 2af30092..59652832 100644 --- a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs +++ b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs @@ -56,7 +56,10 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning // Windows shortcut files ".url", - ".lnk" + ".lnk", + + // gitignore files + ".gitignore" }; /// The extensions for packed content files. -- cgit From 2a05e287821c3ce48a79705d39d190b84c48d361 Mon Sep 17 00:00:00 2001 From: Nuz / Lovegood Date: Sun, 10 Apr 2022 23:33:32 -0700 Subject: Revert "Make ModScanner ignore .gitignore files." This reverts commit c92efc65ce7cbfbca3e92e027141e6b8d90073c8. --- src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/SMAPI.Toolkit/Framework') diff --git a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs index 59652832..2af30092 100644 --- a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs +++ b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs @@ -56,10 +56,7 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning // Windows shortcut files ".url", - ".lnk", - - // gitignore files - ".gitignore" + ".lnk" }; /// The extensions for packed content files. -- cgit From 25e0b4b8ada9ce7aa02f9eafaf5e0609977685c4 Mon Sep 17 00:00:00 2001 From: Nuz / Lovegood Date: Sun, 10 Apr 2022 23:34:50 -0700 Subject: Make IsRelevant return false for any files starting with "." --- src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/SMAPI.Toolkit/Framework') diff --git a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs index 2af30092..12333c4e 100644 --- a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs +++ b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs @@ -306,8 +306,8 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning /// The file or folder. private bool IsRelevant(FileSystemInfo entry) { - // ignored file extension - if (entry is FileInfo file && this.IgnoreFileExtensions.Contains(file.Extension)) + // ignored file extensions and any files starting with "." + if ((entry is FileInfo file) && (this.IgnoreFileExtensions.Contains(file.Extension) || file.Name.StartsWith("."))) return false; // ignored entry name -- cgit