diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-12-21 12:25:27 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-12-21 12:25:27 -0500 |
commit | 71284e7176c55f66754470b19fd74b5b1fda4964 (patch) | |
tree | 848a7ec8c99e0e1f8335fac41f9e417dc1c86e40 /src/SMAPI.Toolkit/Framework/ModScanning | |
parent | 85b947dced10f5398055af36b5fdb6b8d32a6a6b (diff) | |
parent | 872a1d5627f20faece618644db1ae4749e124741 (diff) | |
download | SMAPI-71284e7176c55f66754470b19fd74b5b1fda4964.tar.gz SMAPI-71284e7176c55f66754470b19fd74b5b1fda4964.tar.bz2 SMAPI-71284e7176c55f66754470b19fd74b5b1fda4964.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Toolkit/Framework/ModScanning')
-rw-r--r-- | src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs index 6d6b6417..5eacee9e 100644 --- a/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs +++ b/src/SMAPI.Toolkit/Framework/ModScanning/ModScanner.cs @@ -112,10 +112,20 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning if (manifestFile == null) { FileInfo[] files = this.RecursivelyGetRelevantFiles(searchFolder).ToArray(); + + // empty folder if (!files.Any()) return new ModFolder(root, searchFolder, ModType.Invalid, null, ModParseError.EmptyFolder, "it's an empty folder."); + + // XNB mod if (files.All(this.IsPotentialXnbFile)) return new ModFolder(root, searchFolder, ModType.Xnb, null, ModParseError.XnbMod, "it's not a SMAPI mod (see https://smapi.io/xnb for info)."); + + // SMAPI installer + if (files.Any(p => p.Name == "install on Linux.sh" || p.Name == "install on Mac.command" || p.Name == "install on Windows.bat")) + return new ModFolder(root, searchFolder, ModType.Invalid, null, ModParseError.ManifestMissing, "the SMAPI installer isn't a mod (you can delete this folder after running the installer file)."); + + // not a mod? return new ModFolder(root, searchFolder, ModType.Invalid, null, ModParseError.ManifestMissing, "it contains files, but none of them are manifest.json."); } |